forked from lgvorg1/cicd_top10_3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpr_target.yml.new.txt
78 lines (66 loc) · 2.6 KB
/
pr_target.yml.new.txt
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: PR TARGET CI
on:
pull_request_target:
branches: [ main ]
env:
MY_SECRET: ${{ secrets.MY_SECRET }}
GITHUB_PAT: ${{ secrets.GH_PAT }}
PR_ID: ${{github.event.number}}
jobs:
preflight-job:
name: Preflight Step
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get all .github chnages
id: changed-files-yaml
uses: tj-actions/changed-files@v40
with:
files_yaml: |
github:
- .github/**
- name: fail step if test file(s) change
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files-yaml.outputs.github_any_changed == 'true'
#uses: actions/github-script@v3
#with:
# script: |
# echo "One or more test file(s) has changed."
# echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.github_all_changed_files }}"
# core.setFailed('.github files changed')
run: |
echo "One or more test file(s) has changed."
echo "List all the files that have changed: ${{ steps.changed-files-yaml.outputs.github_all_changed_files }}"
#exit 1
- name: SUCCESS step if test file(s) does not change
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files-yaml.outputs.github_any_changed == 'false'
run: |
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
prt_build_and_upload:
runs-on: ubuntu-latest
steps:
- name: Checking out PR code
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Default: 1
fetch-depth: '0'
# This is to get the PR code instead of the repo code
ref: ${{ github.event.pull_request.head.sha }}
- name: Building ...
run: |
mkdir ./bin
touch ./bin/mybin.exe
echo "${{github.event.pull_request.title}}" > ./bin/PR_TITLE.txt
echo "$PR_ID" > ./bin/PR_ID.txt
ls -lR
#env:
# PR_TITLE: ${{github.event.pull_request.title}}
- name: Archive building artifacts
uses: actions/upload-artifact@v3
with:
name: archive-bin
path: |
bin