diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 017d642..a6ec6ab 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -10,20 +10,22 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history - - name: Configure Git - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" - - name: Push to remote mirror - env: - GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} - run: | - git remote add gitlab https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.tugraz.at/plasma/code.git - CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) - git push gitlab $CURRENT_BRANCH + - name: Push to remote mirror + env: + GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} + run: | + git remote add gitlab https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.tugraz.at/plasma/code.git + CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + git push gitlab $CURRENT_BRANCH + if: >- + github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.actor != 'github-merge-queue[bot]') || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'full-ci')) diff --git a/.github/workflows/repo-hygiene.yml b/.github/workflows/repo-hygiene.yml index e362362..b60c17b 100644 --- a/.github/workflows/repo-hygiene.yml +++ b/.github/workflows/repo-hygiene.yml @@ -2,10 +2,16 @@ name: Repository hygiene on: pull_request: merge_group: + push: + branches: + - main permissions: contents: read jobs: repo-hygiene: - uses: itpplasma/.github/.github/workflows/repo-hygiene.yml@ea1b6401dad136e8b61206fe0647d6ecc772523b + uses: itpplasma/.github/.github/workflows/repo-hygiene.yml@dd4e7ef8217afa34e70efe4dc6a9289f6b5176b2 with: - hygiene-revision: ea1b6401dad136e8b61206fe0647d6ecc772523b + hygiene-revision: dd4e7ef8217afa34e70efe4dc6a9289f6b5176b2 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || format('{0}-{1}', github.ref, github.run_id) }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }}