This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
forked from yichengt900/MOM6_OBGC_examples
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (48 loc) · 2.04 KB
/
NWA12_RT.yaml
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
# This is a basic workflow to help you get started with Actions
name: NWA12_RT
# Controls when the workflow will run
on:
# Triggers the workflow on pull request events as well as specific label
pull_request:
branches: [ "dev/cefi" ]
types: [ labeled ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "NWA12_RT_run"
NWA12_RT_run:
# run RT only when label 'NWA12_RT_gaea_c5' is on
if: ${{ github.event.label.name == 'NWA12_RT_gaea_c5' }}
# The type of runner that the job will run on
runs-on: self-hosted
env:
PR_NUMBER: ${{ github.event.number }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3
# Run create_run_xml_from_template.bash
- name: create and run FRE xml
run: |
pwd
cd ci
bash create_run_xml_from_template.bash
- name: Add "pass_NWA12_RT" label on success
if: success() && contains(github.event.label.name, 'NWA12_RT_gaea_c5')
run: |
TOKEN=${{ secrets.GITHUB_TOKEN }}
RT_TEST_LABEL="NWA12_RT_gaea_c5"
PASS_LABEL="pass_NWA12_RT"
# Remove the "NWA12_RT_gaea_c5" label
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels/$RT_TEST_LABEL"
# Add the "pass_NWA12_RT" label
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" \
-d "{\"labels\":[\"$PASS_LABEL\"]}"