Skip to content

Index has been updated #2867

Index has been updated

Index has been updated #2867

Workflow file for this run

name: "Check whether to make new release"
on:
push:
branches:
- 'main'
paths:
- 'index.json'
# Pushing tag will retrigger so we don't want
# to end up in an infinite loop!
tags-ignore:
- '**'
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# See https://github.community/t/push-from-action-even-with-pat-does-not-trigger-action/17622/6
persist-credentials: false
- name: Generate diff
run: |
echo "\`\`\`diff" > changes.md
git diff $(git describe --tags --abbrev=0)..HEAD index.json >> changes.md
echo "\`\`\`" >> changes.md
- name: Compress index
run: tar -czvf index.tar.gz index.json
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S%z')"
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.PAT_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Index update for ${{ steps.date.outputs.date }}
body_path: changes.md
token: ${{ secrets.PAT_TOKEN }}
files: index.tar.gz
tag_name: ${{ steps.tag_version.outputs.new_tag }}
env:
GITHUB_REPOSITORY: marcus-crane/khinsider-index