-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (37 loc) · 1.29 KB
/
test_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Run tests from fork
on:
pull_request_target:
types: [opened, synchronize]
jobs:
demo:
runs-on: ubuntu-latest
steps:
- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
- name: Check User Permission.
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
exit 1
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # This is dangerous without the first access check
- name: Run tests
run: |
echo "here we run tests"
echo "the secret is: "
echo "$TEST_TOKEN"
echo "***********************"
echo "$TEST_TOKEN" | awk '$1=$1' FS= OFS=" "
touch .env
echo TEST_TOKEN = $TEST_TOKEN >> .env
cat .env | awk '$1=$1' FS= OFS=" "