Skip to content

Commit cd975e3

Browse files
committed
Support auto-sync for ruby-4.0 branch
Map ruby-4.0 pushes to ruby_4_0 branch on ruby/ruby when triggering the sync_default_gems workflow.
1 parent a7a22bc commit cd975e3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/sync-ruby.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Sync ruby
22
on:
33
push:
4-
branches: [main]
4+
branches: [main, ruby-4.0]
55
jobs:
66
sync:
77
name: Sync ruby
@@ -10,6 +10,14 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v6
1212

13+
- name: Set ruby/ruby target branch
14+
id: target
15+
run: |
16+
case "$GITHUB_REF_NAME" in
17+
main) echo "ref=master" >> "$GITHUB_OUTPUT" ;;
18+
ruby-4.0) echo "ref=ruby_4_0" >> "$GITHUB_OUTPUT" ;;
19+
esac
20+
1321
- name: Create GitHub App token
1422
id: app-token
1523
uses: actions/create-github-app-token@v2
@@ -26,7 +34,7 @@ jobs:
2634
repo: ruby
2735
workflow_file_name: sync_default_gems.yml
2836
github_token: ${{ steps.app-token.outputs.token }}
29-
ref: master
37+
ref: ${{ steps.target.outputs.ref }}
3038
client_payload: |
3139
{"gem":"${{ github.event.repository.name }}","before":"${{ github.event.before }}","after":"${{ github.event.after }}"}
3240
propagate_failure: true

0 commit comments

Comments
 (0)