Skip to content

Commit d90f6e2

Browse files
authored
Merge pull request #144 from paritytech/fix-rfc-workflow-use-pr
ci: number-rfc creates a PR instead of pushing to main
2 parents f729ce0 + d8a5916 commit d90f6e2

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/number-rfc.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11+
pull-requests: write
1112

1213
jobs:
1314
number-rfc:
@@ -106,14 +107,24 @@ jobs:
106107
107108
mv _index.md.tmp _index.md
108109
109-
- name: Commit and push
110+
- name: Create PR if changes exist
111+
env:
112+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110113
run: |
111114
git config user.name "github-actions[bot]"
112115
git config user.email "github-actions[bot]@users.noreply.github.com"
113116
if git diff --cached --quiet && git diff --quiet; then
114117
echo "Nothing to commit."
115118
exit 0
116119
fi
120+
BRANCH="ci/update-rfc-index-$(date +%s)"
121+
git checkout -b "$BRANCH"
117122
git add docs/rfcs/
118123
git commit -m "Update RFC index"
119-
git push
124+
git push origin "$BRANCH"
125+
gh pr create \
126+
--title "ci: update RFC index" \
127+
--body "Auto-generated by the number-rfc workflow." \
128+
--head "$BRANCH" \
129+
--base main \
130+
--reviewer paritytech/host-sdk-team

0 commit comments

Comments
 (0)