From 16b9d7ef9e0d462000ab83d0825db159c4041c56 Mon Sep 17 00:00:00 2001 From: lcenchew Date: Mon, 17 Aug 2020 00:52:26 +0800 Subject: [PATCH] feat: add Personal access token (PAT) https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token --- action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d8f1489..24c1643 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,15 @@ inputs: branch: description: 'Branch to merge to. For example, master' default: 'master' + token: + description: > + Personal access token (PAT) used to fetch the repository. The PAT is configured + with the local git config, which enables your scripts to run authenticated git + commands. The post-job step removes the PAT. + We recommend using a service account with the least permissions necessary. + Also when generating a new PAT, select the least scopes necessary. + [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) + default: ${{ github.token }} runs: using: "composite" @@ -23,7 +32,8 @@ runs: git remote add -f upstream "https://github.com/${{ inputs.upstream }}.git" git remote -v git branch --all + git config --list git checkout ${{ inputs.branch }} git merge --ff-only upstream/${{ inputs.upstream-branch }} git push - shell: bash \ No newline at end of file + shell: bash