Skip to content

Commit

Permalink
workflows/update-versions: create PR instead
Browse files Browse the repository at this point in the history
We can't push directly to main because of branch protection, and we can't
bypass branch protection without allowing anyone with push access to the
repo to do the same (by modifying a workflow).  Just create a PR instead.
  • Loading branch information
bgilbert committed Feb 15, 2022
1 parent dd8fa05 commit ebd3de5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Update versions
run: ci/update-versions.py
- name: Create commit
run: |
git config user.name 'CoreOS Bot'
git config user.email [email protected]
ci/update-versions.py
- name: Commit and push
run: |
if ! git diff --quiet --exit-code; then
git commit -am "site: update software versions ✨" \
-m "Triggered by update-versions GitHub Action."
# this bypasses CI due to GitHub recursion prevention
git push
fi
- name: Open pull request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.COREOSBOT_RELENG_TOKEN }}
branch: update-versions
push-to-fork: coreosbot-releng/fedora-coreos-docs
title: "site: update software versions ✨"
body: "Created by update-versions [GitHub workflow](${{ github.server_url }}/${{ github.repository }}/actions/workflows/update-versions.yml) ([source](${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/update-versions.yml))."
committer: "CoreOS Bot <[email protected]>"
author: "CoreOS Bot <[email protected]>"

0 comments on commit ebd3de5

Please sign in to comment.