Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/subtree-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Internal sync PR

on:
push:
branches:
- slice/internal # every push to this branch triggers the job

permissions: # required for the built-in token from 2024-08 onwards
contents: write # create/update branches
pull-requests: write # open/update PRs

jobs:
open-pr:
runs-on: ubuntu-latest
concurrency: # never run two of these at once
group: pr-slice-internal
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh picks this up automatically
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0} # full history, just in case

- name: Ensure PR exists
run: |
set -euo pipefail

# Does an open PR from slice/internal -> master already exist?
pr_number=$(gh pr list \
--head slice/internal \
--base master \
--state open \
--json number \
--jq '.[0].number' || true)

if [[ -z "$pr_number" ]]; then
echo "No open PR found – creating one."
gh pr create \
--head slice/internal \
--base master \
--title "Sync slice/internal → master" \
--body "Automated PR – triggered by commit $GITHUB_SHA"
else
echo "PR #$pr_number already exists – nothing to do."
fi
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ A discount strategy that allows a product owner to set a discount for a product
## Contributing

You will need a copy of [Foundry](https://github.com/foundry-rs/foundry) installed before proceeding. See the [installation guide](https://github.com/foundry-rs/foundry#installation) for details.

TEST9

1 change: 1 addition & 0 deletions test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test 2
Loading