Skip to content

Commit a49920a

Browse files
committed
fix: bring back PR number
1 parent e8781dc commit a49920a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/actions/find-artifact/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ inputs:
77
re-sign:
88
description: Re-sign the app bundle with new JS bundle
99
required: false
10+
pr-number:
11+
description: The pull request number
12+
required: false
1013
github-token:
1114
description: A GitHub Personal Access Token with write access to the project
1215
required: false
@@ -27,6 +30,9 @@ outputs:
2730
artifact-ids:
2831
description: 'All IDs of the artifacts matching the name'
2932
value: ${{ steps.find-artifact.outputs.artifact-ids }}
33+
artifact-name:
34+
description: 'The name of the artifact - will append the PR number if the artifact is re-signed'
35+
value: ${{ steps.find-artifact.outputs.artifact-name }}
3036
runs:
3137
using: 'composite'
3238
steps:
@@ -41,5 +47,6 @@ runs:
4147
INPUT_RE_SIGN: ${{ inputs.re-sign }}
4248
INPUT_GITHUB_TOKEN: ${{ inputs.github-token }}
4349
INPUT_REPOSITORY: ${{ inputs.repository }}
50+
INPUT_PR_NUMBER: ${{ inputs.pr-number }}
4451
run: node ${{ github.action_path }}/index.mjs
4552
shell: bash

.github/actions/find-artifact/index.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ async function fetchArtifacts(octokit, repository, name) {
3030
return result;
3131
}
3232

33-
function getPrNumber() {
34-
if (github.context.eventName === "pull_request") {
35-
return github.context.payload.pull_request.number;
36-
}
37-
return undefined;
38-
}
39-
4033
async function run() {
4134
try {
4235
const token = core.getInput("github_token") || process.env.GITHUB_TOKEN;
@@ -56,7 +49,7 @@ async function run() {
5649
}
5750

5851
const reSign = core.getInput("re_sign");
59-
const prNumber = getPrNumber();
52+
const prNumber = core.getInput("pr_number");
6053

6154
const octokit = github.getOctokit(token);
6255
const artifactsByName = await fetchArtifacts(octokit, repository, name);

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ runs:
105105
with:
106106
name: ${{ env.ARTIFACT_NAME }}
107107
re-sign: ${{ inputs.re-sign }}
108+
github-token: ${{ inputs.github-token }}
109+
pr-number: ${{ github.event.pull_request.number }}
108110

109111
- name: Install Java
110112
if: ${{ !steps.find-artifact.outputs.artifact-url }}

0 commit comments

Comments
 (0)