chore(deps): update dependency @types/node to v16.18.121 #377
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: test | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, labeled] | |
jobs: | |
test: | |
name: | | |
${{ contains(github.event.pull_request.labels.*.name, 'test') && 'test' || 'add the "test" label to the PR to run the required test' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- uses: ./ | |
name: Setup | |
id: github-script-ts | |
with: | |
build: npm run format && npm run test && npm run build | |
- uses: ./ | |
name: Setup | |
id: github-script-ts-2 | |
with: | |
path: .github | |
build: npm run format && npm run test && npm run build | |
- uses: ./ | |
name: Setup | |
id: github-script-ts-3 | |
with: | |
path: ${{ github.workspace }}/.github | |
build: npm run format && npm run test && npm run build | |
- name: Run prNumber | |
id: prNumber | |
if: github.event_name == 'pull_request' | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
function: prNumber | |
- name: Validate result | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "PR number is ${{ steps.prNumber.outputs.result }}" | |
- name: Get label | |
if: github.event.act != 'true' && github.event_name == 'pull_request' | |
id: getLabel | |
uses: ./ | |
env: | |
PR_NUMBER: ${{ steps.prNumber.outputs.result }} | |
LABEL: "test" | |
with: | |
path: ${{ github.workspace }}/.github | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
function: getLabel | |
- if: github.event.act != 'true' && github.event_name == 'pull_request' | |
run: | | |
[ "${{ steps.getLabel.outputs.result }}" == "test" ] | |
- name: exportVariable suprisingly works when called in a composite run step in act | |
id: exportVariable | |
if: github.event.act == 'true' | |
env: | |
OUTPUT_NAME: "SHOULD_NOT_WORK" | |
OUTPUT_VALUE: "cool" | |
uses: ./ | |
with: | |
path: .github | |
function: setOutput | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- if: github.event.act == 'true' | |
run: | | |
set -x | |
[ "${{ steps.exportVariable.outputs.SHOULD_NOT_WORK }}" == "cool" ] | |
- name: exportVariable does not bubble up from composite run steps on actions runners | |
id: exportVariableActions | |
if: github.event.act != 'true' | |
env: | |
OUTPUT_NAME: "SHOULD_NOT_WORK" | |
OUTPUT_VALUE: "uh oh" | |
uses: ./ | |
with: | |
function: setOutput | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- if: github.event.act != 'true' | |
run: | | |
set -x | |
[ "${{ steps.exportVariableActions.outputs.SHOULD_NOT_WORK }}" == "" ] | |
- name: Run setOutput function using actions/github-script | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
id: setOutput | |
env: | |
OUTPUT_NAME: "SET_OUTPUT" | |
OUTPUT_VALUE: "worked" | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
result-encoding: string | |
script: | | |
const { setOutput } = await import("${{ steps.github-script-ts.outputs.module }}"); | |
const result = await setOutput({core}); | |
- run: | | |
set -x | |
[ "${SET_OUTPUT}" == "worked" ] | |
[ "${{ steps.setOutput.outputs.SET_OUTPUT }}" == "worked" ] | |
[ "${{ env.SET_OUTPUT }}" == "worked" ] |