From 150361936d25e8fc382d27744a5b2a736afd5b1b Mon Sep 17 00:00:00 2001 From: BacLuc Date: Tue, 11 Oct 2022 11:21:23 +0200 Subject: [PATCH] debug action --- .github/workflows/fast-forward.yml | 38 +++++++++++++----------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/fast-forward.yml b/.github/workflows/fast-forward.yml index e3637394f9d..288ddde3fdf 100644 --- a/.github/workflows/fast-forward.yml +++ b/.github/workflows/fast-forward.yml @@ -7,17 +7,20 @@ on: jobs: fast_forward_job: name: Fast Forward - # Check this issue is a pull request - # Check the comment contains the trigger string - # Check the comment author has appropriate permissions - if: | - (github.event.issue.pull_request != null) && - contains(github.event.comment.body, '/fast-forward') && - contains(github.event.comment.author_association, 'OWNER') - + runs-on: ubuntu-latest steps: - + - name: get conditions + env: + PULL_REQUEST: ${{ github.event.issue.pull_request }} + PR_EMPTY: ${{ github.event.issue.pull_request != '' }} + COMMENT_BODY: ${{ github.event.comment.body }} + COMMENT_BODY_COND: $${{ github.event.comment.body == '/fast-forward' }} + AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }} + AUTHOR_ASSOCIATION_COND: ${{ contains(github.event.comment.author_association, 'OWNER') }} + run: printenv + + # To use this repository's private action, you must check out the repository - name: Checkout uses: actions/checkout@v2 @@ -26,20 +29,11 @@ jobs: - name: Fast Forward PR id: ff-action uses: endre-spotlab/fast-forward-js-action@2.1 + if: | + (github.event.issue.pull_request != '') && + github.event.comment.body == '/fast-forward' && + contains(github.event.comment.author_association, 'OWNER') with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} success_message: 'Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` ' failure_message: 'Failed! Cannot do fast forward!' - # Advanced use case example - # - name: Fast Forward PR - # id: ff-action - # uses: endre-spotlab/fast-forward-js-action@2.1 - # with: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # success_message: 'Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` ' - # failure_message: 'Failed! Cannot do fast forward!' - # update_status: true - # failure_message_same_stage_and_prod: 'Failed! Possible reasons: ***1)Your feature branch ```source_head``` is outdated***. You need to rebase ```git checkout source_head && git pull --rebase origin prod_branch && git push --force``` ***2)Review required***, pull-request is not approved ***3)Checks were not successful*** (build status check failed)' - # failure_message_diff_stage_and_prod: 'Failed! Possible reasons: ***1)```stage_branch``` is currently in use***. Another feature validation is ongoing. You need to wait. Later, when integration finishes, you will need to rebase ```git checkout source_head && git pull --rebase origin prod_branch && git push --force``` ***2)Review required***, pull-request is not approved ***3)Checks were not successful*** (build status check failed)' - # production_branch: 'master' - # staging_branch: 'staging'