Skip to content

Parse labels with emojis #1463

Parse labels with emojis

Parse labels with emojis #1463

Workflow file for this run

name: "Pull Request Workflow"
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
jobs:
# validates that the pull request is trusted
verify:
runs-on: ubuntu-latest
steps:
- run: |
VERIFIED_LABEL=${{ contains(github.event.pull_request.labels.*.name, 'verified') }}
if [[ ( $VERIFIED_LABEL == 'false' ) ]]; then
echo "Pull request is not from a trusted source!"
exit 1
fi
# unit tests
unit-tests:
needs: [ verify ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- run: npm install
- run: npm run all
# test action works running from the graph
enforce-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.ACTION_TOKEN }}
- id: read_version
run: |
echo "version=$(jq -r ".version" package.json)" >> $GITHUB_OUTPUT
echo "tag=v$(jq -r ".version" package.json)" >> $GITHUB_OUTPUT
- uses: dangoslen/dependabot-changelog-helper@v3
with:
activationLabel: 'dependabot'
- uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
commit_message: "Update changelog"
- id: changelog-enforcer
uses: ./
with:
skipLabels: "skip-changelog"
expectedLatestVersion: ${{ steps.read_version.outputs.tag }}
- if: failure()
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hey @${{ github.event.pull_request.user.login }}, the Changelog Enforcer failed. Can you take a look at the error below and correct it? Thanks!
```
${{ steps.changelog-enforcer.outputs.errorMessage }}
```
comment_tag: "changelog-failed"
- id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: "${{ steps.read_version.outputs.tag }}"
path: ./CHANGELOG.md
- id: check_release
run: |
TAG=$(git ls-remote --tags origin | grep ${{ steps.read_version.outputs.tag }} | cat )
MISSING=$([[ -z "$TAG" ]] && echo 'true' || echo 'false')
echo "missing=$MISSING" >> $GITHUB_OUTPUT
- if: ${{ steps.check_release.outputs.missing == 'true' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
<details>
<summary>Preview of Release Notes to be Created</summary>
${{ steps.changelog_reader.outputs.changes }}
</details>
comment_tag: "relase-note-preview"