mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-18 06:41:03 -10:00
* [ci] add test changelog workflow * update main changelog workflow * delete changelog_2 workflow * use correct command * select last commit author as automated changelog change author
49 lines
1.8 KiB
YAML
49 lines
1.8 KiB
YAML
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
name: Changelog
|
|
|
|
jobs:
|
|
pr-commented:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.issue.pull_request && github.event.issue.user.login == github.event.comment.user.login && startsWith(github.event.comment.body, '/changelog-entry ') }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.EXPO_BOT_PAT }}
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 18
|
|
- name: Checkout Pull Request
|
|
run: hub pr checkout ${{ github.event.issue.number }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Install dependencies
|
|
working-directory: ./scripts
|
|
run: yarn install --frozen-lockfile --check-files
|
|
- name: Add changelog entry
|
|
working-directory: ./scripts
|
|
run: |
|
|
PARAMS=${PR_COMMENT_BODY#/changelog-entry }
|
|
if [[ ! "$PARAMS" =~ " " ]]; then
|
|
echo "Invalid /changelog-entry command"
|
|
exit 1
|
|
fi
|
|
CATEGORY=$( cut -d ' ' -f 1 <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
|
|
MESSAGE=$( cut -d ' ' -f 2- <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
|
|
yarn changelog-entry "$CATEGORY" "$MESSAGE"
|
|
env:
|
|
GITHUB_PR_AUTHOR: ${{ github.event.issue.user.login }}
|
|
GITHUB_PR_NUMBER: ${{ github.event.issue.number }}
|
|
PR_COMMENT_BODY: ${{ github.event.comment.body }}
|
|
- name: Commit and push
|
|
run: |
|
|
# use the last commit author name and email
|
|
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
|
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
|
|
|
git add CHANGELOG.md
|
|
git commit -m "update CHANGELOG.md"
|
|
git push
|