Closed Technetium1 closed 2 years ago
How would you want me to address this ?
As you noticed this action ( Platane/snk ) did not manipulate your git repository. The second one ( crazy-max/ghaction-github-pages) did. There are already comments to explain what each action does.
I found the way to commit files without overwrite the output
branch,
just use actions/checkout@v4 instead of crazy-max/ghaction-github-pages
:
steps:
+ # checkout output branch
+ - name: checkout output branch
+ uses: actions/checkout@v4
+ with:
+ ref: output
# generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
- name: generate github-contribution-grid-snake.svg
uses: Platane/snk/svg-only@v3
with:
github_user_name: ${{ github.repository_owner }}
outputs: |
- dist/github-contribution-grid-snake.svg
- dist/github-contribution-grid-snake-dark.svg?palette=github-dark
./github-contribution-grid-snake.svg
./github-contribution-grid-snake-dark.svg?palette=github-dark
# push the content of <build_dir> to a branch
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
- name: push github-contribution-grid-snake.svg to the output branch
- uses: crazy-max/ghaction-github-pages@v3.1.0
- with:
- target_branch: output
- build_dir: dist
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add .
+ git commit -m "Update github-contribution-grid-snake by [bot]"
+ git push
This needs to have a warning. The action should not destroy the commit history. Luckily GitHub support was able to recover my last commit.
Example: