Skip to content

Commit 5c0b4c7

Browse files
ddbeckElchi3
andauthored
Improve weekly spec drafts updating GitHub Actions workflow (#1694)
* Use create-pull-request action to create the commit * Stage removals so dropped files are in the diff * Use sentence case * Use a label instead of a title string to note that it's a generated PR * Link back to workflow file Co-authored-by: Florian Scholz <[email protected]>
1 parent fc5b60d commit 5c0b4c7

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.github/workflows/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/labeler@v5
13+
- if: github.event.pull_request.user.login == 'dependabot[bot]'
14+
run: gh pr edit ${{ github.event.pull_request.number }} --add-label "generated"

.github/workflows/update_draft_features_weekly.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update Draft Features
33
on:
44
# Runs at midnight on Mondays 05:30 UTC, or manually triggered
55
schedule:
6-
- cron: '30 5 * * 1'
6+
- cron: "30 5 * * 1"
77
workflow_dispatch:
88

99
jobs:
@@ -16,20 +16,21 @@ jobs:
1616
node-version-file: .node-version
1717
cache: npm
1818
- run: npm ci
19-
- run: rm features/draft/spec/*.yml features/draft/spec/*.dist
19+
- run: git rm features/draft/spec/*.yml features/draft/spec/*.dist
2020
- run: npm run update-drafts
2121
- run: npm run dist
22-
- name: Commit changes
23-
run: |
24-
git config --local user.email "[email protected]"
25-
git config --local user.name "GitHub Action"
26-
git add -A
27-
git commit -m "Update draft features weekly" || echo "No changes to commit"
28-
- name: Create Pull Request
22+
- name: Create pull request
2923
uses: peter-evans/create-pull-request@v6
3024
with:
31-
commit-message: Update draft features weekly
32-
title: "[GitHub Actions] Update draft features weekly"
33-
body: "This is an auto-generated PR with draft features by spec updates."
25+
add-paths: |
26+
features/draft/spec/
27+
commit-message: Update draft features
28+
title: "Update draft features weekly"
29+
body: |
30+
This is an auto-generated PR with draft features by spec updates.
31+
32+
See https://github.com/web-platform-dx/web-features/blob/main/.github/workflows/update_draft_features_weekly.yml for details.
33+
labels: |
34+
generated
3435
branch: update-draft-features-${{ github.run_number }}
3536
delete-branch: true

0 commit comments

Comments
 (0)