diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 3ecf66b17da9..402341a9c389 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.NCS_GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..6e2430ec901e 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,6 +4,7 @@ on: types: [opened, synchronize, closed, reopened] branches: - main + - ncs-v*-branch permissions: contents: read @@ -11,9 +12,28 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest + outputs: + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: + # Determine the base branch: + # * sdk-zephyr/main -> sdk-nrf/main + # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch + - name: Set base branch + id: set-base-branch + run: | + if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + echo "base_branch=main" >> "$GITHUB_OUTPUT" + elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then + branch_name="${{ github.event.pull_request.base.ref }}" + branch_name="${branch_name#ncs-}" + echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" + else + echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 + exit 1 + fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} + base-branch: ${{ steps.set-base-branch.outputs.base_branch }}