aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2023-12-27 07:47:11 +0000
committerYuta Saito <kateinoigakukun@gmail.com>2023-12-28 23:53:15 +0900
commite81a5453e3c76c4348da042d86debde7689254fe (patch)
tree587e9c56e4ae69c289670f9b59e538c9c714f393 /.github
parent0990270c38e9f49ae2d18db050c51539bddab82c (diff)
downloadruby-e81a5453e3c76c4348da042d86debde7689254fe.tar.gz
ci: Fixup for 301a7b1e
* Remove debugging code * Fix path to github-pr-info.txt, which is used when labeled before build completes * Add a check to skip the build if the build is completed but the PR is not labeled with Playground
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pr-playground.yml12
-rw-r--r--.github/workflows/wasm.yml4
2 files changed, 9 insertions, 7 deletions
diff --git a/.github/workflows/pr-playground.yml b/.github/workflows/pr-playground.yml
index 28ea7f55ad..cc06006142 100644
--- a/.github/workflows/pr-playground.yml
+++ b/.github/workflows/pr-playground.yml
@@ -22,8 +22,7 @@ jobs:
|| (true
&& github.event_name == 'workflow_run'
&& github.event.workflow_run.conclusion == 'success'
- && github.event.workflow_run.event == 'pull_request'
- )
+ && github.event.workflow_run.event == 'pull_request')
}}
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -73,13 +72,11 @@ jobs:
}
// Workaround for https://github.com/orgs/community/discussions/25220
- console.log(JSON.stringify(context.payload, null, 2));
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
- console.log(JSON.stringify(artifacts, null, 2));
const artifact = artifacts.find(artifact => artifact.name == 'github-pr-info');
if (!artifact) {
throw new Error('Cannot find github-pr-info.txt artifact');
@@ -99,13 +96,18 @@ jobs:
const prNumber = await derivePRNumber();
- console.log(`PR number: ${prNumber}`);
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
+ core.info(`Checking if the PR ${prNumber} is labeled with Playground...`);
+ if (!pr.labels.some(label => label.name == 'Playground')) {
+ core.info(`The PR is not labeled with Playground.`);
+ return;
+ }
+
core.info(`Checking if the build is successful for ${pr.head.ref} in ${pr.head.repo.owner.login}/${pr.head.repo.name}...`);
const buildRun = await findSuccessfuBuildRun(pr);
if (!buildRun) {
diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml
index 8c946eb0cb..1fad62a915 100644
--- a/.github/workflows/wasm.yml
+++ b/.github/workflows/wasm.yml
@@ -163,12 +163,12 @@ jobs:
# Workaround for https://github.com/orgs/community/discussions/25220
- name: Save Pull Request number
if: ${{ github.event_name == 'pull_request' }}
- run: echo "${{ github.event.pull_request.number }}" >> ./github-pr-info.txt
+ run: echo "${{ github.event.pull_request.number }}" >> ${{ github.workspace }}/github-pr-info.txt
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: ${{ github.event_name == 'pull_request' }}
with:
name: github-pr-info
- path: github-pr-info.txt
+ path: ${{ github.workspace }}/github-pr-info.txt
defaults:
run: