@Gate triggered by live-github-bot[bot] on branch renovate/npm-ws-vulnerability #22141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "@PR • Gate" | |
run-name: "@Gate triggered by ${{ github.actor }} ${{ format('on branch {0}', github.head_ref || github.ref) }}" | |
on: | |
pull_request: | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
pull-requests: write | |
env: | |
number: ${{ github.event.pull_request.number || -1 }} | |
head_sha: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} | |
head_branch: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} | |
base_sha: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} | |
base_branch: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }} | |
base_owner: ${{ github.event.pull_request.base.repo.owner.login || github.repository_owner }} | |
is_fork: ${{ github.event.pull_request.head.repo.fork || false }} | |
ref: ${{ github.sha }} | |
jobs: | |
setup: | |
name: "Setup" | |
runs-on: ubuntu-latest | |
outputs: | |
affected: ${{ steps.affected.outputs.affected }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/github-script@v6 | |
id: clean-refs | |
with: | |
script: | | |
const head_branch = "${{ env.head_branch }}"; | |
const base_branch = "${{ env.base_branch }}"; | |
const newHeadBranch = head_branch.replace("refs/heads/", ""); | |
const newBaseBranch = base_branch.replace("refs/heads/", ""); | |
core.exportVariable("head_branch", newHeadBranch); | |
core.exportVariable("base_branch", newBaseBranch); | |
- uses: LedgerHQ/ledger-live/tools/actions/turbo-affected@develop | |
id: affected | |
with: | |
ref: ${{ format('origin/{0}', env.base_branch) }} | |
- uses: actions/github-script@v6 | |
name: create output file ("affected.json") | |
with: | |
script: | | |
const fs = require("fs"); | |
const affected = ${{ steps.affected.outputs.affected }}; | |
fs.writeFileSync("affected.json", JSON.stringify(affected), "utf-8"); | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: affected.json | |
path: affected.json | |
- uses: actions/github-script@v6 | |
name: create output file ("pr_metadata.json") | |
with: | |
script: | | |
const fs = require("fs"); | |
fs.writeFileSync("pr_metadata.json", JSON.stringify({ | |
number: ${{ env.number }}, | |
head_sha: "${{ env.head_sha }}", | |
head_branch: "${{ env.head_branch }}", | |
base_sha: "${{ env.base_sha }}", | |
base_branch: "${{ env.base_branch }}", | |
base_owner: "${{ env.base_owner }}", | |
is_fork: ${{ env.is_fork }}, | |
ref: "${{ env.ref }}" | |
}), "utf-8"); | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pr_metadata.json | |
path: pr_metadata.json |