Skip to content

Reset Github Pages #930

Reset Github Pages

Reset Github Pages #930

name: Reset Github Pages
on:
schedule:
- cron: "00 08 * * *"
permissions:
contents: read
jobs:
reset-gh-pages:
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_APP_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Reset gh-pages git history
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}"
git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}"
git checkout -b gh-pages origin/gh-pages
git checkout --orphan tmp-gh-pages
git add -A
git commit -am "reset history"
git branch -D gh-pages
git branch -m gh-pages
git push -f origin gh-pages