From 83d49db24b9c15e4471ea41f22add68b0f9d2182 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Sun, 18 Jul 2021 11:32:53 -0700 Subject: [PATCH 1/5] HowTo should reference the latest GPO 1.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45b5ec8..f56385f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ How to use it? run: echo "Optional placeholder. Put your project's static website generator command here." - name: Publish current workdir (which contains generated content) to GitHub Pages - uses: rayluo/github-pages-overwriter@v1.1 + uses: rayluo/github-pages-overwriter@v1.2 with: From 1a2fa8927664d29aa36b0b5038443f0c961cf168 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Mon, 2 Aug 2021 17:48:35 -0700 Subject: [PATCH 2/5] Reword the settings intruction --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f56385f..71b7c89 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ How to use it? ``` -2. In your Github Pages setting, choose your publish source like this: +2. In your Github Pages setting, choose your publish source to match your Github Page Overwriter (GPO) settings. - | Github Page Overwriter settings | Github Pages settings | - | ------------------------------- | --------------------- | - | `source-directory` can be any directory you choose | *Always* choose folder `/ (root)` for your publishing source, regardless of what `source-directory` is. ![Choose "/ (root)" as folder](github-pages-settings.png) | - | `target-branch` can be any branch that match the setting on the right | Choose any branch that matches the `target-branch` setting on the left | + | Github Page Overwriter (GPO) settings in your workflow's yml file | Github Pages settings | + | ----------------------------------------------------------------- | --------------------- | + | `target-branch` could be any branch you want to *overwrite* with your static website. By default, it will be "gh_pages". | You MUST choose the branch that matches the `target-branch` setting on the left | + | `source-directory` MUST be the directory containing your "index.html" | *Always* choose folder `/ (root)` for your publishing source, regardless of what `source-directory` is. So, a typical setting looks like this: ![Choose "/ (root)" as folder](github-pages-settings.png) | How does it work? From d8aebb4bbc05d16db2a6baff8c2ba027f97b8bde Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Sun, 1 Jan 2023 19:08:48 -0800 Subject: [PATCH 3/5] Reset commit message so that it won't duplicate --- action.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 177bd07..fb2d6be 100644 --- a/action.yml +++ b/action.yml @@ -27,16 +27,20 @@ runs: git branch -f ${{ inputs.target-branch }} HEAD git checkout ${{ inputs.target-branch }} + # The commit and push happen to work without authentication + # https://docs.github.com/en/actions/reference/authentication-in-a-workflow + git config user.name "Github Pages Overwriter" + git config user.email "GithubPagesOverwriter@users.noreply.github.com" + + # The previous commit message may contain reference to github issues, + # we wipe it out, so that it won't show up in the inevitable duplicate commit. + git commit --amend -m "This commit will be automatically published" + # Generate such a new file to make sure the subsequent commit would succeed # Such a file WITHOUT leading dot (.) is also visible in outcome website. # FYI: filename with leading dot (.) or underscore (_) would be ignored by Jekyll, # which Github Pages depends on. So we use a normal filename here. date > ${{ inputs.source-directory}}/publish_date.txt - - # The commit and push happen to work without authentication - # https://docs.github.com/en/actions/reference/authentication-in-a-workflow - git config user.name "Github Pages Overwriter" - git config user.email "GithubPagesOverwriter@users.noreply.github.com" git add -A git commit -m "Automated publish" From f55b2b186f079fdd60bcabbd5eb2372f1fad4764 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Sun, 1 Jan 2023 20:11:48 -0800 Subject: [PATCH 4/5] Recommend actions/checkout@v3 to avoid node12 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71b7c89..d0da269 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ How to use it? runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate your content run: echo "Optional placeholder. Put your project's static website generator command here." From a62c49d9151b80d04b1db02d7759bc1955d41ce6 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Mon, 2 Jan 2023 08:33:37 -0800 Subject: [PATCH 5/5] Bump version number and update a dead link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0da269..3d43df7 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ How to use it? run: echo "Optional placeholder. Put your project's static website generator command here." - name: Publish current workdir (which contains generated content) to GitHub Pages - uses: rayluo/github-pages-overwriter@v1.2 + uses: rayluo/github-pages-overwriter@v1.3 with: @@ -168,7 +168,7 @@ I did look around. But the following reasons made me start this `Github Pages Ov 3. The Security. Any 3rd-party github action could potentially mess up with your central repo. - [Security concern on github action is a real thing](https://github.community/t/are-github-actions-safe-to-use/17895). + [Security concern on github action is a real thing](https://blog.gitguardian.com/github-actions-security-cheat-sheet/#use-specific-action-version-tags). The only way to be sure, is to review their implementation. This is another reason why “#2 how it is implemented” is important. I feel more comfortable to trust an action that I can fully understand what it works.