Skip to content

Commit 9819c36

Browse files
committed
"shell" not in the shell name; skip CI for README changes
* feature disable source/dest check and timeout for the status check * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * test * check version * check version * check version * Update shell-definition.yaml
1 parent 74e8cde commit 9819c36

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.github/workflows/shells-ci.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- "*"
5+
paths-ignore:
6+
- "README.md"
77
pull_request:
8-
branches:
9-
- "*"
8+
paths-ignore:
9+
- "README.md"
1010
release:
1111
types: [published]
1212

@@ -55,20 +55,48 @@ jobs:
5555
steps:
5656
- name: Checkout code
5757
uses: actions/checkout@v2
58-
- name: Set up Python 3.7
59-
uses: actions/setup-python@v2
58+
- name: Get current version
59+
id: currentVersion
60+
uses: mikefarah/yq@master
6061
with:
61-
python-version: 3.7
62-
- name: Install dependencies
63-
run: |
64-
sudo apt-get -y install jq
65-
pip install yq
66-
- name: Check version
62+
cmd: yq e ".metadata.template_version" shell-definition.yaml
63+
- name: Save shell-definition.yaml from master
6764
run: |
6865
git clone https://github.com/${{ github.repository }}.git ${{ github.repository }}
66+
BASE_DIR=`pwd`
6967
cd ${{ github.repository }}
7068
git checkout -qf ${{ github.head_ref }}
71-
! diff <(yq .metadata.template_version shell-definition.yaml) <(git show master:shell-definition.yaml > tmp.yaml && yq .metadata.template_version tmp.yaml)
69+
git show master:shell-definition.yaml > $BASE_DIR/tmp.yaml
70+
- name: Get master version
71+
id: masterVersion
72+
uses: mikefarah/yq@master
73+
with:
74+
cmd: yq e ".metadata.template_version" tmp.yaml
75+
- name: Check version
76+
run: |
77+
! diff <(echo "${{ steps.currentVersion.outputs.result }}") <(echo "${{ steps.masterVersion.outputs.result }}")
78+
check-not-shell-in-shell-name:
79+
name: Check "Shell" is not in the Shell name
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout code
83+
uses: actions/checkout@v2
84+
- name: get Node Type
85+
id: getNodeType
86+
uses: mikefarah/yq@master
87+
with:
88+
cmd: yq e ".node_types | keys | .[0]" shell-definition.yaml
89+
- name: Check shell is not in the Shell name
90+
run: |
91+
NODE_TYPE="${{ steps.getNodeType.outputs.result }}"
92+
SHELL_NAME=`echo ${NODE_TYPE:16} | tr "[:upper:]" "[:lower:]"`
93+
if [[ $SHELL_NAME == *" shell "* ]]
94+
then
95+
echo "You should remove 'Shell' from the Shell name"
96+
exit 1
97+
else
98+
echo "not found"
99+
fi
72100
create-gh-release:
73101
needs: [pre-commit, pack]
74102
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}

0 commit comments

Comments
 (0)