Skip to content

ci(label): trigger workflows on labelling #13

ci(label): trigger workflows on labelling

ci(label): trigger workflows on labelling #13

Workflow file for this run

name: Label
on:
pull_request:
branches: [master, vara-stage-1, vara-stage-2, vara-stage-3]
types: [labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
status:
runs-on: ubuntu-latest
outputs:
build: ${{ steps.label-checks.outputs.build }}
linux: ${{ steps.label-checks.outputs.linux }}
win: ${{ steps.label-checks.outputs.win }}
macos: ${{ steps.label-checks.outputs.macos }}
steps:
- uses: actions/github-script@v6
id: label-checks
with:
script: |
const [owner, repo] = ["gear-tech", "gear"];
const { ref, payload: { number: issue_number } } = context;
// List all labels of the current pull request.
const { data: labelsArr } = await github.rest.issues.listLabelsOnIssue({
owner,
repo,
issue_number,
});
const labels = labelsArr.map((label) => label.name);
let [linux, macos] = [
labels.includes("A0-pleasereview"),
labels.includes("E2-forcemacos")
];
if (!(linux || macos)) return;
// List the latest check runs
const {
data: { check_runs }
} = await github.rest.checks.listForRef({
owner,
repo,
ref,
});
for (run of check_runs) {
if (run.name === "build / linux") {
linux = false;
} else if (run.name === "build / macos") {
macos = false;
}
}
core.setOutput("build", linux || macos);
core.setOutput("linux", linux);
core.setOutput("win", linux);
core.setOutput("macos", macos)
build:
needs: status
uses: ./.github/workflows/build.yml
if: ${{ needs.status.outputs.build == "true" }}

Check failure on line 68 in .github/workflows/label.yml

View workflow run for this annotation

GitHub Actions / Label

Invalid workflow file

The workflow is not valid. .github/workflows/label.yml (Line: 68, Col: 9): Unexpected symbol: '"true"'. Located at position 31 within expression: needs.status.outputs.build == "true" .github/workflows/label.yml (Line: 71, Col: 14): Unexpected symbol: '"true"'. Located at position 31 within expression: needs.status.outputs.linux == "true"
with:
cache: true
linux: ${{ needs.status.outputs.linux == "true" }}
win: ${{ needs.status.outputs.win == "true" }}
macos: ${{ needs.status.outputs.macos == "true" }}