@@ -26,23 +26,53 @@ jobs:
2626 run : bundle exec rake slack:api:update
2727 - name : Remove files added by setup-ruby
2828 run : rm -rf vendor
29+ - name : Get current date
30+ id : date
31+ run : echo "::set-output name=date::$(date +'%Y-%m-%d')"
32+ - name : Get slack-api-ref ref
33+ id : api-ref
34+ run : echo "::set-output name=api-ref::$(git rev-parse --short HEAD:lib/slack/web/api/slack-api-ref)"
2935 - name : GitHub App token
36+ if : ${{ github.repository == 'slack-ruby/slack-ruby-client' }}
3037 id : github_app_token
31383239 with :
3340 app_id : ${{ secrets.CI_APP_ID }}
3441 private_key : ${{ secrets.CI_APP_PRIVATE_KEY }}
3542 installation_id : 36985419
3643 - name : Create pull request
37- id : create-pull-request
44+ id : cpr
3845 uses : peter-evans/create-pull-request@v4
3946 with :
40- token : ${{ steps.github_app_token.outputs.token }}
41- commit-message : Update API from slack-api-ref
42- title : Update API from slack-api-ref
47+ token : ${{ secrets.GITHUB_TOKEN }}
48+ commit-message : Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }} (${{ steps.date.outputs.date }})
49+ title : Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }}
4350 body : |
44- Update API from [slack-api-ref](https://github.com/slack-ruby/slack-api-ref)
51+ Update API from [slack-api-ref](https://github.com/slack-ruby/slack-api-ref).
52+ Rev: ${{ steps.api-ref.outputs.api-ref }}
53+ Date: ${{ steps.date.outputs.date }}
4554 branch : automated-api-update
4655 base : master
47- committer :
GitHub <[email protected] > 48- author :
GitHub <[email protected] > 56+ committer :
slack-ruby-ci-bot <[email protected] > 57+ author :
slack-ruby-ci-bot <[email protected] > 58+ - name : Fetch pull request
59+ if : ${{ steps.cpr.outputs.pull-request-number != '' }}
60+ run : |
61+ git config user.name slack-ruby-ci-bot
62+ git config user.email [email protected] 63+ git pull
64+ git checkout automated-api-update
65+ - uses : jacobtomlinson/gha-find-replace@v3
66+ if : ${{ steps.cpr.outputs.pull-request-number != '' }}
67+ with :
68+ include : CHANGELOG.md
69+ find : " \\ * Your contribution here."
70+ replace : " * [#${{steps.cpr.outputs.pull-request-number}}](https://github.com/slack-ruby-client/pulls/${{steps.cpr.outputs.pull-request-number}}): Update API from [slack-api-ref@${{ steps.api-ref.outputs.api-ref }}](https://github.com/slack-ruby/slack-api-ref/commit/${{ steps.api-ref.outputs.api-ref }}) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).\n * Your contribution here."
71+ - name : Update pull request
72+ env :
73+ GITHUB_TOKEN : ${{ steps.github_app_token.outputs.token || secrets.GITHUB_TOKEN }}
74+ if : ${{ steps.cpr.outputs.pull-request-number != '' }}
75+ run : |
76+ git add CHANGELOG.md
77+ git commit --amend --no-edit
78+ git push origin automated-api-update -f
0 commit comments