From eddeae05a300ebb634538fa4cc27c7d21d0c58e5 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 16 Dec 2020 09:45:06 -0800 Subject: [PATCH 1/3] Updates README.md I think the skip-commit description was supposed to say do not? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25163fd..962e525 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `version-path`: The place inside the version file to bump. Default `version`. - **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occured when you push `chore` commit with `angular` for example. Default `'true'`. - **Optional** `skip-version-file`: Do not update the version file. Default `'false'`. -- **Optional** `skip-commit`: Do create a release commit. Default `'false'`. +- **Optional** `skip-commit`: Do not create a release commit. Default `'false'`. - **Optional** `pre-commit`: Path to the pre-commit script file. No hook by default. - **Optional** `fallback-version`: The fallback version, if no older one can be detected, or if it is the first one. Default `'0.1.0'` - **Optional** `config-file-path`: Path to the conventional changelog config file. If set, the preset setting will be ignored From 9c6ca6b2e550ef2dc7d1809627ce0137296ceabb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Apr 2021 07:41:35 +0000 Subject: [PATCH 2/3] build(deps): bump y18n from 4.0.0 to 4.0.1 Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e79ac1..0e66a8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2627,9 +2627,9 @@ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true }, "yallist": { From c82c3a1b1de521412af47239e9d46a2c49e7c8c7 Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Mon, 27 Sep 2021 23:08:04 -0600 Subject: [PATCH 3/3] feat: use same permissions used at repo checkout closes #115 --- README.md | 20 ++++++++++++++++---- action.yml | 2 +- src/helpers/git.js | 6 ++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 962e525..72ea55c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This action will bump version, tag commit and generate a changelog with conventi ## Inputs -- **Required** `github-token`: Github token. +- **Optional** `github-token`: Github token, if different permissions required than from checkout. - **Optional** `git-message`: Commit message that is used when committing the changelog. - **Optional** `git-user-name`: The git user.name to use for the commit. Default `Conventional Changelog Action` - **Optional** `git-user-email`: The git user.email to use for the commit. Default `conventional.changelog.action@github.com` @@ -56,9 +56,9 @@ A bunch of useful environment variables are available to the script with `proces ### Pre-Changelog-Generation hook > Function in a specified file will be run right before the changelog generation phase, when the next -> version is already known, but it was not used anywhere yet. It can be useful if you want to manually update version or tag. +> version is already known, but it was not used anywhere yet. It can be useful if you want to manually update version or tag. -Same restrictions as for the pre-commit hook, but exported functions names should be `preVersionGeneration` for modifications to the version and `preTagGeneration` for modifications to the git tag. +Same restrictions as for the pre-commit hook, but exported functions names should be `preVersionGeneration` for modifications to the version and `preTagGeneration` for modifications to the git tag. Following props will be passed to the function as a single parameter and same output is expected: @@ -73,7 +73,7 @@ export function preTagGeneration(tag: string): string {} ### Config-File-Path A config file to define the conventional commit settings. Use it if you need to override values like `issuePrefix` or `issueUrlFormat`. If you set a `config-file-path`, the `preset` setting will be ignored. Therefore use an existing config and override the values you want to adjust. -example: +example: ```javascript 'use strict' const config = require('conventional-changelog-conventionalcommits'); @@ -188,6 +188,18 @@ Github releases body: ${{ steps.changelog.outputs.clean_changelog }} ``` +Use a deploy key + +```yaml +- name: Checkout GitHub Action + uses: actions/checkout@v2 + with: + ssh-key: ${{ secrets.SSH_DEPLOY_KEY }} +- name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 +``` + ## Development If you'd like to contribute to this project, all you need to do is clone and install [act](https://github.com/nektos/act) this project and run: diff --git a/action.yml b/action.yml index 96671c9..0abfd5b 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ branding: inputs: github-token: description: 'Github token' - required: true + required: false git-message: description: 'Commit message to use' diff --git a/src/helpers/git.js b/src/helpers/git.js index 66fc04f..74bb6c2 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -11,7 +11,7 @@ module.exports = new (class Git { commandsRun = [] constructor() { - const githubToken = core.getInput('github-token', { required: true }) + const githubToken = core.getInput('github-token') // Make the Github token secret core.setSecret(githubToken) @@ -37,7 +37,9 @@ module.exports = new (class Git { this.config('user.email', gitUserEmail) // Update the origin - this.updateOrigin(`https://x-access-token:${githubToken}@github.com/${GITHUB_REPOSITORY}.git`) + if (githubToken) { + this.updateOrigin(`https://x-access-token:${githubToken}@github.com/${GITHUB_REPOSITORY}.git`) + } } /**