From 12aac6853e668ce77f32d2077f45a26f1d8a96a1 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 17 Jul 2023 16:11:01 +0200 Subject: [PATCH] Minor generation workflow bugfix (#2187) --- .github/workflows/generate.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 4a6a119cbd..f04fe5837b 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -24,6 +24,8 @@ defaults: jobs: build: runs-on: ubuntu-latest + # The actor check currently does not work. The `secrets.PAT` belongs to `delvedor` and not + # `elasticmachine`. We should make sure to change this in the future. if: github.repository_owner == 'elastic' && github.actor != 'elasticmachine' steps: - name: Checkout @@ -51,7 +53,7 @@ jobs: - name: Check for Changed Files id: changes run: | - if [ -n "$(git status --porcelain)" ]; then + if [ -n "$(git status --porcelain ./output)" ]; then echo "has-changes=1" >> $GITHUB_OUTPUT fi @@ -64,13 +66,8 @@ jobs: - name: Push Output if: steps.changes.outputs.has-changes == '1' run: | - cd ./output - - git add -A + git add -A ./output git commit -m "Update specification output" - - git status - git push # For debugging purposes: @@ -79,14 +76,9 @@ jobs: # env: # BRANCH_NAME: output_${{ github.run_id }}_${{ github.run_attempt }} # run: | - # cd ./output - # git fetch # git switch main - # git add -A + # git add -A ./output # git commit -m "Update specification output" - - # git status - # git push origin HEAD:refs/heads/${{ env.BRANCH_NAME }}