diff --git a/.github/workflows/hello.yaml b/.github/workflows/hello.yaml index 4da7327380..83cc81cfd9 100644 --- a/.github/workflows/hello.yaml +++ b/.github/workflows/hello.yaml @@ -5,12 +5,9 @@ on: branches: - develop_badgetest types: [closed] - -#env: -# SOME_VAR: bla_bla_bla -# ANOTHER_VAR: stuff_stuff - + jobs: + print: runs-on: ubuntu-latest outputs: @@ -27,11 +24,6 @@ jobs: echo "some_var=$SOME_VAR" >> $GITHUB_OUTPUT echo "another var: $ANOTHER_VAR" echo "another_var=$ANOTHER_VAR" >> $GITHUB_OUTPUT - - echo "some var: $SOME_VAR" - echo "some_var=$SOME_VAR" >> $GITHUB_ENV - echo "another var: $ANOTHER_VAR" - echo "another_var=$ANOTHER_VAR" >> $GITHUB_ENV passed: runs-on: ubuntu-latest @@ -48,6 +40,3 @@ jobs: env: input_var: ${{ needs.print.outputs.some_var }} another_input_var: ${{ needs.print.outputs.another_var }} - input_var_env: ${{ needs.print.env.some_var }} - another_input_var_env: ${{ needs.print.env.another_var }} - diff --git a/.github/workflows/hera.yaml b/.github/workflows/hera.yaml index 88fb4af9ee..e968f0ea73 100644 --- a/.github/workflows/hera.yaml +++ b/.github/workflows/hera.yaml @@ -7,6 +7,7 @@ on: types: [closed] jobs: + get_labels: runs-on: ubuntu-latest outputs: @@ -18,16 +19,27 @@ jobs: run: | labels="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name')" >> $GITHUB_OUTPUT echo "$labels" - echo "test=foo" >> $GITHUB_OUTPUT - echo "test=foo" >> $GITHUB_ENV + echo "test=$FOO" >> $GITHUB_OUTPUT env: - test: foo_bar + FOO: foobar GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO_NAME: ${{ github.event.repository.name }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} - - + + test: + runs-on: ubuntu-latest + needs: + - get_labels + + steps: + - name: Test + run: | + echo "labels: $labels" + echo "test: $test" + env: + labels: ${{ needs.get_labels.outputs.labels }} + test: ${{ needs.get_labels.outputs.test }} passed: runs-on: ubuntu-latest @@ -46,20 +58,6 @@ jobs: label: Hera message: Passed color: green - - test: - runs-on: ubuntu-latest - needs: - - get_labels - - steps: - - name: Test - run: | - echo "labels: $labels" - echo "test: $test" - env: - labels: ${{ needs.get_labels.outputs.labels }} - test: ${{ needs.get_labels.outputs.test }} pending: if: "!contains(steps.pending1.env.labels, 'CI-Hera-Passed') && ${{ github.event.pull_request.merged == true }}"