Skip to content

Commit

Permalink
Merge pull request petehouston#1 from petehouston/test-pull-request
Browse files Browse the repository at this point in the history
Update pull_request
  • Loading branch information
petehouston committed Apr 21, 2021
2 parents d37e0d3 + 547602e commit a49df9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: "github-actions-query-branch-name"
- name: Export as default variable GIT_BRANCH_NAME
uses: ./
id: getGitBranch1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# with:
# path: "github-actions-query-branch-name"
- name: Export as default variable GIT_BRANCH_NAME
uses: ./
id: getGitBranch1
Expand Down
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,15 +475,17 @@ async function run() {

// check if this is a pull request
if (process.env.GITHUB_EVENT_NAME === 'pull_request') {
const baseBranchName = process.env.GITHUB_BASE_REF.split('/').slice(2).join('/');
// const baseBranchName = process.env.GITHUB_BASE_REF;
const baseBranchName = process.env.GITHUB_BASE_REF;
core.exportVariable(`${name}_BASE`, baseBranchName);
core.setOutput(`${OutputGitBranchName}_base`, baseBranchName);

const headBranchName = process.env.GITHUB_HEAD_REF.split('/').slice(2).join('/');
// const headBranchName = process.env.GITHUB_HEAD_REF;
const headBranchName = process.env.GITHUB_HEAD_REF;
core.exportVariable(`${name}_HEAD`, headBranchName);
core.setOutput(`${OutputGitBranchName}_head`, headBranchName);

// set default branch name to head
core.exportVariable(name, headBranchName);
core.setOutput(OutputGitBranchName, headBranchName);
}
}
catch (error) {
Expand Down
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ async function run() {

// check if this is a pull request
if (process.env.GITHUB_EVENT_NAME === 'pull_request') {
const baseBranchName = process.env.GITHUB_BASE_REF.split('/').slice(2).join('/');
// const baseBranchName = process.env.GITHUB_BASE_REF;
const baseBranchName = process.env.GITHUB_BASE_REF;
core.exportVariable(`${name}_BASE`, baseBranchName);
core.setOutput(`${OutputGitBranchName}_base`, baseBranchName);

const headBranchName = process.env.GITHUB_HEAD_REF.split('/').slice(2).join('/');
// const headBranchName = process.env.GITHUB_HEAD_REF;
const headBranchName = process.env.GITHUB_HEAD_REF;
core.exportVariable(`${name}_HEAD`, headBranchName);
core.setOutput(`${OutputGitBranchName}_head`, headBranchName);

// set default branch name to head
core.exportVariable(name, headBranchName);
core.setOutput(OutputGitBranchName, headBranchName);
}
}
catch (error) {
Expand Down

0 comments on commit a49df9a

Please sign in to comment.