From 73723876372f74bd46391f8fdb8405d06a81e15d Mon Sep 17 00:00:00 2001 From: Marius Ghita Date: Thu, 11 Jan 2024 18:12:28 +0200 Subject: [PATCH] chore: repo-ansible run --- .devcontainer/git/linkorb_commit.template | 2 +- .github/workflows/repo-ansible.yaml | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.devcontainer/git/linkorb_commit.template b/.devcontainer/git/linkorb_commit.template index 20e8490..aebfec1 100644 --- a/.devcontainer/git/linkorb_commit.template +++ b/.devcontainer/git/linkorb_commit.template @@ -1,4 +1,4 @@ -# See https://engineering.linkorb.com/topics/github-codespaces/articles/commit-standards for more information +# See https://engineering.linkorb.com/topics/git/articles/commit-standards/ for more information # # Write a 50-character or less commit header below # It should take the form: [scope]: # diff --git a/.github/workflows/repo-ansible.yaml b/.github/workflows/repo-ansible.yaml index 4905bb0..d17ee74 100644 --- a/.github/workflows/repo-ansible.yaml +++ b/.github/workflows/repo-ansible.yaml @@ -1,6 +1,8 @@ name: repo-ansible on: + workflow_dispatch: + pull_request_target: paths: - 'repo.yaml' @@ -23,10 +25,16 @@ jobs: run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - if: ${{ env.IS_PULL_REQUEST == '0' }} + uses: actions/checkout@v4 with: path: current - ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || '' }} + + - if: ${{ env.IS_PULL_REQUEST == '1' }} + uses: actions/checkout@v4 + with: + path: current + ref: refs/pull/${{ github.event.pull_request.number }}/merge - uses: actions/checkout@v4 with: @@ -67,8 +75,9 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git commit -m "chore: repo-ansible run" - git push + if git commit -m "chore: repo-ansible run"; then + git push + fi - if: ${{ env.IS_PULL_REQUEST == '1' && env.REPOSITORY_CHANGED == '1' }}