aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update_mergify.yml
diff options
context:
space:
mode:
authorJack Koenig2021-04-19 13:58:21 -0700
committerGitHub2021-04-19 13:58:21 -0700
commit9c868ca02e5eb99bc317f92fd75252e0ab9fb7a2 (patch)
tree94f34fe6d141ea52a186d9809c51cbfc6c70d313 /.github/workflows/update_mergify.yml
parent72afdefd0f2e894d5dfe346aae36a23b2fd25def (diff)
Simplify "update .mergify.yml" workflow (#2192)
Diffstat (limited to '.github/workflows/update_mergify.yml')
-rw-r--r--.github/workflows/update_mergify.yml42
1 files changed, 17 insertions, 25 deletions
diff --git a/.github/workflows/update_mergify.yml b/.github/workflows/update_mergify.yml
index d2067a42..fbcdebd7 100644
--- a/.github/workflows/update_mergify.yml
+++ b/.github/workflows/update_mergify.yml
@@ -11,6 +11,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
+ with:
+ ref: master
- name: Checkout Chisel Repo Tools
uses: actions/checkout@v2
with:
@@ -23,31 +25,21 @@ jobs:
- name: Cache Scala
uses: coursier/cache-action@v6
- name: Generate .mergify.yml
- id: gen
run: |
./tools/scripts/mergify.sc .github/configs/mergify_config.yml > .mergify.yml
- diff=$(git diff -- .mergify.yml)
- echo "::set-output name=diff::$diff"
- - name: Commit and Push
- if: ${{ steps.gen.outputs.diff }}
- run: |
- BRANCH="actions/workflows/update-mergify"
- git config --local user.email "action@github.com"
- git config --local user.name "GitHub Action"
- git checkout -B $BRANCH
- git add .mergify.yml
- git commit -m "Update .mergify.yml"
- git push --follow-tags --force --set-upstream origin $BRANCH
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Open/Update Pull Request
- if: ${{ steps.gen.outputs.diff }}
- uses: vsoch/pull-request-action@1.0.15
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- PULL_REQUEST_FROM_BRANCH: actions/workflows/update-mergify
- PULL_REQUEST_BRANCH: master
- PULL_REQUEST_TITLE: "Update .mergify.yml"
- PULL_REQUEST_BODY: "This is an automated pull request by \"Update .mergify.yml\" workflow"
- PASS_IF_EXISTS: true
+ # Delete tools so they don't get included in commit
+ rm -rf tools/
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v3.8.2
+ with:
+ # TODO Default GITHUB_TOKEN cannot trigger PR CI
+ token: ${{ secrets.GITHUB_TOKEN }}
+ commit-message: Update .mergify.yml
+ branch: actions/workflows/update-mergify
+ delete-branch: true
+ title: Update .mergify.yml
+ body: |
+ This is an automated pull request by "Update .mergify.yml" workflow created with [create-pull-request][1].
+
+ [1]: https://github.com/peter-evans/create-pull-request