1name: CI Tests
2on:
3  pull_request_target:
4    types: [labeled]
5
6jobs:
7  trivial:
8    runs-on: ubuntu-latest
9    if: contains(github.event.pull_request.labels.*.name, 'ci:test')
10    name: CI Machinery Tests
11    steps:
12      - name: Checkout Repo
13        uses: actions/checkout@v2
14      - name: show selected vars
15        run: |
16          echo "GITHUB_ACTOR: $GITHUB_ACTOR"
17          echo "GITHUB_HEAD_REF:  $GITHUB_HEAD_REF"
18          echo "GITHUB_BASE_REF:  $GITHUB_BASE_REF"
19          echo "GITHUB_REF:  $GITHUB_REF"
20          echo "GITHUB_REPOSITORY:  $GITHUB_REPOSITORY"
21          echo "GITHUB_SHA:  $GITHUB_SHA"
22          echo ${{ github.event.number }}
23      - name: create json file
24        run: |
25          python3 .github/assets/write_json.py -f ./.tests/test.json
26      - name: commit ci info file
27        run: |
28          git config --local user.email "$(git log --format='%ae' HEAD^!)"
29          git config --local user.name "$(git log --format='%an' HEAD^!)"
30          git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
31          git pull github ${GITHUB_REF}
32          git add .
33          git commit -m "adding ci data"
34          git push --force github HEAD:${GITHUB_HEAD_REF}
35
36