Skip to content
Open
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
66 changes: 66 additions & 0 deletions .github/actions/composite/getMergedPullRequest/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Get merged pull request
description: Given the current push event's commit SHA, finds the pull request that was merged to produce it.

inputs:
github_token:
description: GitHub token used to call the API
required: true

outputs:
number:
description: The PR number
value: ${{ steps.getMergedPR.outputs.number }}
title:
description: The PR title
value: ${{ steps.getMergedPR.outputs.title }}
body:
description: The PR body
value: ${{ steps.getMergedPR.outputs.body }}
labels:
description: Newline-separated label names
value: ${{ steps.getMergedPR.outputs.labels }}
assignees:
description: Newline-separated assignee logins
value: ${{ steps.getMergedPR.outputs.assignees }}

runs:
using: composite
steps:
- name: Find merged pull request for this commit
id: getMergedPR
shell: bash
run: |
RESP=$(gh api -H "Accept: application/vnd.github+json" "/repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls")

# Prefer the PR whose merge_commit_sha matches exactly (parity with the old action)
PR=$(echo "$RESP" | jq -c "first(.[] | select(.merge_commit_sha == \"${GITHUB_SHA}\"))" 2>/dev/null)

# Fall back to the first merged PR associated with this commit
if [[ -z "$PR" || "$PR" == "null" ]]; then
PR=$(echo "$RESP" | jq -c 'first(.[] | select(.merged_at != null))' 2>/dev/null)
fi

if [[ -z "$PR" || "$PR" == "null" ]]; then
echo "::warning::No merged pull request found for commit ${GITHUB_SHA}"
exit 0
fi

{
echo "number=$(echo "$PR" | jq -r '.number')"
echo "title=$(echo "$PR" | jq -r '.title')"

echo "body<<GETMPR_EOF"
echo "$PR" | jq -r '.body // ""'
echo "GETMPR_EOF"

echo "labels<<GETMPR_LABELS_EOF"
echo "$PR" | jq -r '[.labels[].name] | join("\n")'
echo "GETMPR_LABELS_EOF"

echo "assignees<<GETMPR_ASSIGNEES_EOF"
echo "$PR" | jq -r '[.assignees[].login] | join("\n")'
echo "GETMPR_ASSIGNEES_EOF"

} >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
2 changes: 1 addition & 1 deletion .github/workflows/androidBump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
android_bump:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/authorChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
&& github.actor != 'imgbot[bot]'
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: authorChecklist.ts
uses: ./.github/actions/javascript/authorChecklist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checkSVGCompression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ jobs:

# v4
- name: Checkout target branch
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ inputs.TARGET }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/createDeployChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Check out
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: main
submodules: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
IOS_VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }}
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
submodules: true
Expand Down Expand Up @@ -641,8 +641,8 @@ jobs:
needs: [androidBuild, androidUploadGooglePlay, androidUploadBrowserStack, androidUploadApplause, androidSubmit, iosBuild, iosUploadTestflight, iosUploadBrowserStack, iosUploadApplause, iosSubmit, webBuild, webDeploy]
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Post Slack message on failure
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployBlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Give the issue/PR the Hourly, Engineering labels
run: gh issue edit ${{ github.event.issue.number }} --add-label 'Engineering,Hourly' --remove-label 'Daily,Weekly,Monthly'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployBlockerInvestigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
ISSUE_URL: ${{ github.event.issue.html_url || inputs.ISSUE_URL }}
steps:
- name: Checkout App repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployExpensifyHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
continue-on-error: true
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
# We start by checking out the entire repo into a clean build environment within
# the Github Action
- name: Checkout code
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

# Set up Ruby and run bundle install inside the /help directory
- name: Set up Ruby
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Get merged pull request
if: ${{ github.event_name == 'push' }}
id: getMergedPullRequest
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9
uses: ./.github/actions/composite/getMergedPullRequest
with:
github_token: ${{ github.token }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/failureNotifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Process Failed Jobs
uses: ./.github/actions/javascript/failureNotifier
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
isValid: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) && !fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS) }}
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/formatCodeCovComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
if: github.event.issue.pull_request && github.event.comment.user.login == 'codecov[bot]'
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Format CodeCov Comment
uses: ./.github/actions/javascript/formatCodeCovComment
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generateTranslations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

# v4
# v6
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ steps.pr-data.outputs.HEAD_SHA }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
REPO: ${{ github.repository }}

- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: ${{ fromJSON(steps.count.outputs.count) }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lockDeploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Wait for staging deploys to finish
uses: ./.github/actions/javascript/awaitStagingDeploys
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/postDeployComments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if: ${{ always() }}

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Exit failed workflow
if: ${{ needs.typecheck.result == 'failure' || needs.lint.result == 'failure' || needs.test.result == 'failure' }}
Expand All @@ -42,11 +42,11 @@ jobs:
SHOULD_DEPLOY: ${{ fromJSON(steps.shouldDeploy.outputs.SHOULD_DEPLOY) }}

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Get merged pull request
id: getMergedPullRequest
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9
uses: ./.github/actions/composite/getMergedPullRequest
with:
github_token: ${{ github.token }}

Expand All @@ -73,12 +73,13 @@ jobs:
if: ${{ !fromJSON(needs.chooseDeployActions.outputs.SHOULD_DEPLOY) && github.actor != 'OSBotify' }}
steps:
- name: Comment on deferred PR
uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac
with:
github_token: ${{ secrets.OS_BOTIFY_TOKEN }}
number: ${{ needs.chooseDeployActions.outputs.MERGED_PR }}
body: |
:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.
run: |
gh pr comment ${{ needs.chooseDeployActions.outputs.MERGED_PR }} --body "$(cat <<'EOF'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass repository explicitly to deferred deploy comment

skipDeploy now runs gh pr comment with only a PR number, but this job no longer checks out the repository. In gh pr comment docs, repository selection is inherited from parent flags (-R/--repo) when local repo context is absent; without checkout and without -R, this path can fail to resolve the repo and the job will error when deploy is skipped (the common non-deployer/checklist-locked path). Please add --repo ${{ github.repository }} (or set GH_REPO) so commenting works reliably in this checkout-free job.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot update gh pr comment to pass the repo flag as described in this codex comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codex comment is correct — the skipDeploy job has no actions/checkout step, so gh pr comment won't have local repo context to resolve the target repository. The fix is to add --repo ${{ github.repository }} to the gh pr comment call.

The current line:

gh pr comment ${{ needs.chooseDeployActions.outputs.MERGED_PR }} --body "$(cat <<'EOF'

Should be:

gh pr comment ${{ needs.chooseDeployActions.outputs.MERGED_PR }} --repo ${{ github.repository }} --body "$(cat <<'EOF'

⚠️ I can't push changes to this PR because I didn't open it and I'm not listed as an assignee. To have me make this fix, add me to the PR assignees and then retry your request.

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.
EOF
)"
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

createNewVersion:
needs: chooseDeployActions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
# v4
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proposalPolice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
if: "!contains(fromJSON('[\"OSBotify\", \"imgbot[bot]\", \"melvin-bot[bot]\", \"codecov[bot]\"]'), github.actor)"
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

# Checks if the comment is created and follows the template OR
# if the comment is edited and if proposal template is followed.
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publishReactNativeAndroidArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
standalone_patches_hash: ${{ steps.getNewPatchesHash.outputs.STANDALONE_APP_HASH }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: true
ref: ${{ github.event.before || 'main' }}
Expand Down Expand Up @@ -138,7 +139,8 @@ jobs:
cancel-in-progress: true
steps:
- name: Checkout Code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: ${{ matrix.is_hybrid }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/react-compiler-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404

steps:
# v4
# v6
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Setup Node
uses: ./.github/actions/composite/setupNode
Expand Down
Loading
Loading