Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
Adding a warning message about deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-casella-adams committed Oct 6, 2021
1 parent 375b477 commit 02da049
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
45 changes: 11 additions & 34 deletions .github/workflows/increment-version-on-merge.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,26 @@
# Workflow Code: AngryGoose_v2 DO NOT REMOVE

name: Increment Version on Merge
on:
on:
pull_request:
types: [closed]

jobs:
increment-version:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: [ubuntu-20.04]

runs-on: ubuntu-20.04

steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

# See https://github.com/im-open/git-version for more details around how to increment major/minor/patch through commit messages
- name: Increment the version
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const util = require('util');
const exec = util.promisify(require('child_process').exec);
let newTag;
try {
({ stdout: tag } = await exec(`git describe --tags --abbrev=0`));
tag = tag.replace('\n', '').trim();
core.info(`The latest tag is: ${tag}`);
const majorMinorPatch = tag.split('.');
const patch = parseInt(majorMinorPatch[2]) + 1;
newTag = `${majorMinorPatch[0]}.${majorMinorPatch[1]}.${patch}`
core.info(`The new tag is: ${newTag}`);
}
catch (error) {
newTag = 'v1.0.0';
core.info('An error occurred getting the tags for the repo. It most likely does not have any tags to use. Defaulting to v1.0.0.');
core.info(error);
}
core.info(`Pushing tag '${newTag}' to the repository...`)
await github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${newTag}`,
sha: context.sha
});
uses: im-open/[email protected]
with:
create-ref: true
github-token: ${{ secrets.GITHUB_TOKEN }}
default-release-type: major
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5560,6 +5560,7 @@ var includePrefixInOutput = core.getInput('include-prefix-in-output') == 'true';
var ghToken = core.getInput('github-token');
var octokit = github.getOctokit(ghToken);
async function run() {
core.warning('This action has been deprecated. Use https://github.com/im-open/git-version-lite instead.');
let newTagToReturn;
let newTagToPush;
try {
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const ghToken = core.getInput('github-token');
const octokit = github.getOctokit(ghToken);

async function run() {
core.warning('This action has been deprecated. Use https://github.com/im-open/git-version-lite instead.');

let newTagToReturn; //This is what is set in the env var/output. It may or may not include the prefix
let newTagToPush; //This is the new tag and it will include the prefix.

Expand Down

0 comments on commit 02da049

Please sign in to comment.