-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.46 KB
/
check_validated_by_qc_code.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
39
40
41
42
43
44
45
46
47
48
name: Check if outputs are validated by a qc program in another branch
on:
pull_request:
branches:
- main
- dev
jobs:
check_if_outputs_are_qced:
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
pull-requests: write
discussions: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Current branch
id: get-branch
run: echo "::set-output name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
- name: Check qc branch exists
id: qc-branch-exists
run: |
echo $BRANCH_NAME
QC_BRANCH_NAME="${BRANCH_NAME}_qc"
echo $QC_BRANCH_NAME
git ls-remote --exit-code --heads origin $QC_BRANCH_NAME >/dev/null 2>&1
EXIT_CODE=$?
if [[ $EXIT_CODE == '0' ]]; then
echo "A qc branch called '$QC_BRANCH_NAME' exists in the remote repository"
elif [[ $EXIT_CODE == '2' ]]; then
echo "A qc branch called '$QC_BRANCH_NAME' does not exist in the remote repository"
echo "Please investigate why the qc branch doesn't exist."
echo "For e.g. has the qc programmer sync-ed their code to the remote repository?"
exit 1
fi
env:
BRANCH_NAME: ${{ steps.get-branch.outputs.BRANCH_NAME }}
- name: Get checksum for prod
run: |
git diff --name-only dev .hashes/