Skip to content
Merged
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
14 changes: 10 additions & 4 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ permissions:
jobs:
automerge:
runs-on: ubuntu-slim
if: github.repository == 'JabRef/jabref'
# In JabRef/jabref, on-pr-opened-updated.yml removes "automerge" when a human pushes; the black-forest
# repository has no such cleanup, so a human push there must not be acted on with a stale label.
if: >
github.repository == 'JabRef/jabref' ||
(github.repository == 'JabRef/jabref-black-forest' &&
!(github.event.action == 'synchronize' && !contains(fromJSON('["dependabot[bot]", "renovate-bot", "jabref-machine"]'), github.event.sender.login)))
# Serialize with on-pr-labeled.yml's automerge job (same group) so the
# approve guard never races: the second run starts only after the first
# finished and its approval is visible.
Expand Down Expand Up @@ -42,8 +47,8 @@ jobs:
exit 0
fi

if [[ "$HEAD_REPO" != "JabRef/jabref" ]]; then
echo "🚫 not from JabRef/jabref"
if [[ "$HEAD_REPO" != "$GITHUB_REPOSITORY" ]]; then
echo "🚫 not from $GITHUB_REPOSITORY"
echo "shouldrun=false" >> "$GITHUB_OUTPUT"
exit 0
fi
Expand Down Expand Up @@ -71,7 +76,8 @@ jobs:
env:
GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
- name: Approve PR
if: steps.shouldrun.outputs.shouldrun == 'true'
# jabref-machine cannot approve its own PRs (ports); on-pr-labeled.yml approves those
if: steps.shouldrun.outputs.shouldrun == 'true' && github.event.pull_request.user.login != 'jabref-machine'
# Guard: a push directly followed by adding the "automerge" label makes both this
# workflow (live label query) and on-pr-labeled.yml approve — skip if an
# un-dismissed approval by jabref-machine already exists.
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
- main-release
- stable
- black-forest
paths-ignore:
- 'docs/**'
- 'src/test/**'
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:
echo "should-notarize=false" >> "$GITHUB_OUTPUT"

if [[ "${{ github.event_name }}" == "push" ]]; then
if [[ "${{ github.ref_name }}" == "main" || "${{ github.ref_name }}" == "stable" ]]; then
if [[ "${{ github.ref_name }}" == "main" || "${{ github.ref_name }}" == "black-forest" ]]; then
echo "☁️ Push to \`${{ github.ref_name }}\` – will upload"
echo "☁️ Push to \`${{ github.ref_name }}\` – will upload" >> $GITHUB_STEP_SUMMARY
echo "upload-to-builds-jabref-org=true" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
]
}'

if [[ "$GITHUB_REF" != "refs/heads/main" && "$GITHUB_REF" != "refs/heads/stable" && "$SHOULD_NOTARIZE" != "true" ]]; then
if [[ "$GITHUB_REF" != "refs/heads/main" && "$GITHUB_REF" != "refs/heads/black-forest" && "$SHOULD_NOTARIZE" != "true" ]]; then
# drop macos-15-intel
MATRIX_JSON="$(jq -c ' .include |= map(select(.os != "macos-15-intel")) ' <<<"$MATRIX_JSON")"
else
Expand Down Expand Up @@ -523,6 +523,9 @@ jobs:
with:
fetch-depth: 0
show-progress: 'false'
- name: Fetch upstream release tags
if: needs.conditions.outputs.should-build == 'true' && github.repository == 'JabRef/jabref-black-forest'
run: git fetch https://github.com/JabRef/jabref.git 'refs/tags/*:refs/tags/*'
- name: Install GitVersion
if: needs.conditions.outputs.should-build == 'true'
id: pre-gitversion
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jabls-native-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
- main-release
- stable
- black-forest
paths:
- 'jabls/**'
- 'jabls-cli/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jabsrv-native-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
- main-release
- stable
- black-forest
paths:
- 'jabsrv/**'
- 'jabsrv-cli/**'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/on-pr-bug-linked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Inherit label and milestone from linked issue

# [impl->req~ci.port-to-other-branch.label-driven-ports~1]
# [impl->adr~single-stable-branch-with-automatic-ports~1]
# Adds "dev: into-stable" when a PR into main links an issue of type "bug" for the
# Adds "dev: send-to-black-forest" when a PR into main links an issue of type "bug" for the
# first time: at creation, or when an edit of the body adds a new issue link. A push never
# triggers this, and a link that was already there never counts again - so a maintainer's
# decision to remove (or add) the label by hand sticks.
Expand All @@ -28,7 +28,7 @@ jobs:
(github.event.action == 'opened' || github.event.changes.body)
runs-on: ubuntu-slim
steps:
- name: 'Add "dev: into-stable" for a newly linked bug'
- name: 'Add "dev: send-to-black-forest" for a newly linked bug'
env:
# PAT: a label added with GITHUB_TOKEN would not trigger the "Would merge into the other branch" check
GH_TOKEN: ${{ secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE }}
Expand Down Expand Up @@ -67,8 +67,9 @@ jobs:
fi
# GitHub stores the type name in lower case ("bug") while the issue template writes "Bug"
if [ "$labeled" = false ] && [ "${type,,}" = "bug" ]; then
gh pr edit "$PR_NUMBER" --add-label "dev: into-stable"
echo "Added \`dev: into-stable\`" >> "$GITHUB_STEP_SUMMARY"
# `gh pr edit` queries fields that need the read:org scope, which the token lacks
gh api "repos/JabRef/jabref/issues/$PR_NUMBER/labels" -f "labels[]=dev: send-to-black-forest" > /dev/null
echo "Added \`dev: send-to-black-forest\`" >> "$GITHUB_STEP_SUMMARY"
labeled=true
fi
done
18 changes: 15 additions & 3 deletions .github/workflows/on-pr-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,28 @@ jobs:
name: Auto Merge
if: >
github.event.label.name == 'automerge' &&
github.repository == 'JabRef/jabref' &&
github.event.pull_request.head.repo.full_name == 'JabRef/jabref'
(github.repository == 'JabRef/jabref' || github.repository == 'JabRef/jabref-black-forest') &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: write
# Same concurrency group as automerge.yml's automerge job: serializes the
# two workflows per PR so the approve guard below cannot race.
concurrency:
group: automerge-pr-${{ github.event.pull_request.number }}
cancel-in-progress: false
steps:
- name: Approve a port PR
# jabref-machine cannot approve its own PRs (ports, opened from the other repository);
# github-actions[bot] does it instead - for ports only
if: github.event.pull_request.user.login == 'jabref-machine' && startsWith(github.event.pull_request.head.ref, 'port-')
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Approve PR
if: github.event.pull_request.user.login != 'jabref-machine'
# Guard: automerge.yml (running for a push made just before the label was added)
# queries labels live and may approve concurrently — skip if an un-dismissed
# approval by jabref-machine already exists.
Expand Down Expand Up @@ -51,7 +63,7 @@ jobs:
steps:
- name: Create pr_number.txt
run: echo "${{ github.event.pull_request.number }}" > pr_number.txt
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: pr_number
path: pr_number.txt
Loading
Loading