Skip to content

Commit

Permalink
Determine branch
Browse files Browse the repository at this point in the history
  • Loading branch information
wdbasson committed Jan 31, 2024
1 parent a92ea02 commit c17f289
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/continuous-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,16 @@ jobs:
uses: actions/github-script@v5
with:
script: |
const { GITHUB_TOKEN } = process.env;
const { context } = require('@actions/github');
const github = require('@actions/github').getOctokit(GITHUB_TOKEN);
const branch = context.ref.replace('refs/heads/', '');
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const octokit = require('@actions/github').getOctokit(GITHUB_TOKEN);
const branchName = process.env.GITHUB_REF.replace('refs/heads/', '');
try {
await github.rest.repos.getBranch({
owner: context.repo.owner,
repo: context.repo.repo,
branch: branch,
await octokit.rest.repos.getBranch({
owner: process.env.GITHUB_REPOSITORY_OWNER,
repo: (process.env.GITHUB_REPOSITORY).split('/')[1],
branch: branchName,
});
return branch;
return branchName;
} catch (error) {
return 'master';
}
Expand All @@ -360,7 +359,6 @@ jobs:
path: charts
ref: ${{ steps.set_branch.outputs.result }}


- name: Install dependencies
run: sudo apt-get install -y postgresql-client redis-tools

Expand Down

0 comments on commit c17f289

Please sign in to comment.