Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit d0a2464

Browse files
authored
Merge pull request #10 from sodadata/nonpr
Set proper job metadata when run on non-pr branch
2 parents cc2ba5d + 835be3b commit d0a2464

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- nonpr
78
pull_request:
89
workflow_dispatch:
910

action.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,24 @@ runs:
4545

4646
# 2. Need to expand the environment variables to pass to the docker run command
4747
# as these variables can be configured in the workflow file and contain secrets etc.
48-
- name: Expand environment variables
49-
id: expand_envs
48+
- name: Set job related envs for PR
49+
if: ${{ github.event_name == 'pull_request' }}
5050
env:
51-
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
52-
PR_TITLE: ${{ github.event.pull_request.title }}
53-
PR_URL: ${{ github.event.pull_request.html_url }}
54-
PR_NUMBER: ${{ github.event.pull_request.number }}
51+
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
52+
PR_TITLE: ${{ github.event.pull_request.title }}
53+
PR_URL: ${{ github.event.pull_request.html_url }}
54+
PR_NUMBER: ${{ github.event.pull_request.number }}
55+
run: |
56+
env > .env_file
57+
shell: bash
58+
59+
- name: Set job related envs for non-PR
60+
if: ${{ github.event_name != 'pull_request' }}
61+
env:
62+
BRANCH_NAME: ${{ github.ref_name }}
63+
PR_TITLE: ${{ github.event.head_commit.message }}
64+
PR_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
65+
PR_NUMBER: false
5566
run: |
5667
env > .env_file
5768
shell: bash

0 commit comments

Comments
 (0)