Skip to content

Commit 06c6a06

Browse files
Apply suggestions from code review by chancancode
Co-authored-by: Godfrey Chan <[email protected]>
1 parent 9145f7f commit 06c6a06

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,41 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- name: Clone ember-jsonapi-docs
19+
uses: actions/checkout@v2
20+
with:
21+
path: ember-jsonapi-docs # This puts all the cloned projects side-by-side, which seems to be what the README suggests and seems less confusing to me when reading the remaining steps
1922

20-
- name: Clone the project repo
21-
run: |
22-
set -euo pipefail
23-
if [$INPUT_PROJECT -eq 'ember']
24-
then
25-
git clone https://github.com/emberjs/ember.js
26-
cd ember.js
27-
git checkout "v$INPUT_VERSION"
28-
elif [$INPUT_PROJECT -eq 'ember-data']
29-
then
30-
git clone https://github.com/emberjs/data
31-
cd data
32-
git checkout "v$INPUT_VERSION"
33-
else
34-
echo "Please specify either ember or ember-data for the project."
35-
fi
23+
- name: Clone ember.js
24+
uses: actions/checkout@v2
25+
if: ${{ github.event.inputs.project == "ember" }}
26+
with:
27+
repository: emberjs/ember.js
28+
path: ember.js
29+
ref: v${{ github.event.inputs.version }}
30+
31+
- name: Clone ember-data
32+
uses: actions/checkout@v2
33+
if: ${{ github.event.inputs.project == "ember-data" }}
34+
with:
35+
repository: emberjs/data
36+
path: data
37+
ref: v${{ github.event.inputs.version }}
3638

3739
- name: Clone ember-api-docs-data
3840
run: git clone https://github.com/ember-learn/ember-api-docs-data
3941

40-
- name: yarn install
42+
- name: Install dependencies
43+
working-directory: ember-jsonapi-docs
4144
run: yarn install
4245

4346
- name: Generate s3-docs
4447
working-directory: ember-jsonapi-docs
45-
run: yarn gen --project $INPUT_PROJECT --version $INPUT_VERSION
48+
run: yarn gen --project "${{ github.event.inputs.project }}" --version "${{ github.event.inputs.version }}"
4649

4750
- name: Generate json-docs
4851
working-directory: ember-jsonapi-docs
49-
run: yarn start --project $INPUT_PROJECT --version $INPUT_VERSION
52+
run: yarn start --project "${{ github.event.inputs.project }}" --version "${{ github.event.inputs.version }}"
5053

5154
pull-request:
5255
name: Open a pull request in ember-api-docs-data
@@ -62,8 +65,13 @@ jobs:
6265
with:
6366
ssh-private-key: ${{ secrets.GUIDES_SOURCE_DEPLOY_KEY }}
6467

65-
- name: commit the changes
66-
run: cd .. && git add . && git commit -m "${INPUT_PROJECT}-${INPUT_VERSION}"
68+
- name: Stage changes
69+
working-directory: ember-api-docs-data
70+
run: git add .
71+
72+
- name: Commit changes
73+
working-directory: ember-api-docs-data
74+
run: git commit -m "${{ github.event.inputs.project }}-{{ github.event.inputs.version }}"
6775

6876
- name: Push
6977
working-directory: ember-api-docs-data

0 commit comments

Comments
 (0)