fix: Create template #14
Workflow file for this run
This file contains 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
# Sample workflow for building and deploying a mdBook site to GitHub Pages | |
# | |
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html | |
# | |
name: Create template from uploads | |
on: | |
# Runs on pushes targeting the default branch | |
pull_request_target: | |
types: [opened, reopened, synchronize] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Create template job | |
create: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: "Checkout repository" | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: "Install NodeJS dependencies" | |
run: | | |
npm ci | |
- name: "Get pull request and create new template" | |
env: | |
Title: ${{ github.event.pull_request.title }} | |
Body: ${{ github.event.pull_request.body }} | |
Repo: ${{github.repository}} | |
Branch: ${{github.head_ref}} | |
run: | | |
npm run create_template | |
git add -A | |
git config user.email "btpiconbot@users.noreply.github.com" | |
git config user.name "BTP Icon Bot" | |
git diff --quiet && git diff --staged --quiet || git commit -m "[bot]: Added template" | |
git push | |