From 03f6b7c0be39c51e77e08e8e7e24f52cdaf2b525 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Thu, 11 May 2023 12:40:08 +0200 Subject: [PATCH] New check author workflow (#808) * New check author workflow * Fix checkout of alire-index-checks --- .github/workflows/authorship.yml | 38 +++++++++++++++++++ .../workflows/{main.yml => check-index.yml} | 6 +-- 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/authorship.yml rename .github/workflows/{main.yml => check-index.yml} (83%) diff --git a/.github/workflows/authorship.yml b/.github/workflows/authorship.yml new file mode 100644 index 00000000..84bbe91f --- /dev/null +++ b/.github/workflows/authorship.yml @@ -0,0 +1,38 @@ +name: Check Author + +env: + CHECKS_ORG: alire-project + CHECKS_REPO: alire-index-checks + +on: + pull_request: + paths: + - 'index/**.toml' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + # Needed to be able to diff and obtain changed files. Furthermore, we + # need the full history or else grafted partial branches confuse the + # changed files detectors. + + - name: Check out alire-index-checks + uses: actions/checkout@v3 + with: + repository: ${{env.CHECKS_ORG}}/${{env.CHECKS_REPO}} + ref: ${{github.base_ref}} + path: ${{env.CHECKS_REPO}} + + - name: Set up nightly `alr` + uses: alire-project/setup-alire@v2 + with: + version: nightly + toolchain: --disable-assistant + + - name: Test authorship + run: ${{env.CHECKS_REPO}}/scripts/check-author.sh "${{ github.event.pull_request.user.login }}" + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/check-index.yml similarity index 83% rename from .github/workflows/main.yml rename to .github/workflows/check-index.yml index 91aca76d..f4f61746 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/check-index.yml @@ -1,4 +1,4 @@ -name: Check PR +name: Check Index on: pull_request jobs: build: @@ -6,10 +6,6 @@ jobs: steps: - uses: actions/checkout@master - - uses: alire-project/check-author@master - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Set up stable `alr` if: contains(github.base_ref, 'stable-') uses: alire-project/setup-alire@v2