Skip to content

Commit d547d03

Browse files
authored
directory_writer: actions/checkout@v1 # Use v1, NOT v2 (TheAlgorithms#1799)
* directory_writer: actions/checkout@v1 # Use v1, NOT v2 (TheAlgorithms#1796 * updating DIRECTORY.md
1 parent 2da98db commit d547d03

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/directory_writer.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v1
9+
- uses: actions/checkout@v1 # v1, NOT v2
1010
- uses: actions/setup-python@v1
1111
with:
1212
python-version: 3.x
1313
- name: Write DIRECTORY.md
1414
run: |
1515
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
16-
git config --global user.name "GitHub Actions"
17-
git config --global user.email "actions@github.com"
18-
git commit -am "updating DIRECTORY.md" || true
19-
- name: Push DIRECTORY.md
20-
if: github.ref == 'refs/heads/master'
16+
git config --global user.name github-actions
17+
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
18+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
19+
- name: Update DIRECTORY.md
2120
run: |
22-
git push "https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/$GITHUB_REPOSITORY.git" ${master} --force
21+
git add DIRECTORY.md
22+
git commit -am "updating DIRECTORY.md" || true
23+
git push --force origin HEAD:$GITHUB_REF || true

0 commit comments

Comments
 (0)