Add a photo #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Add a photo" | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: "File name" | |
type: string | |
required: true | |
content: | |
description: "File content" | |
type: string | |
required: true | |
datetime: | |
description: "Datetime" | |
type: string | |
required: true | |
concurrency: ci-${{ github.action }} | |
jobs: | |
process: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: 'master' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 17.7 | |
- name: Run script | |
run: node .github/workflows/scripts/images.js '${{ inputs.datetime }}' '{{ inputs.name}}' '${{ inputs.content }}' | |
- name: Commit and push | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "damian [bot]" | |
git add . | |
git commit -m "Add a photo from Apple shortcuts" || echo "Nothing to commit" | |
git fetch origin master | |
git push origin HEAD:main |