Skip to content

Commit df17e17

Browse files
committed
feat: update workflows to use GH_TOKEN references
1 parent f17e33f commit df17e17

15 files changed

Lines changed: 58 additions & 23 deletions

.github/workflows/build-citus-community-nightlies.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ jobs:
4444
private-key: ${{ secrets.GH_APP_KEY }}
4545
owner: ${{ github.repository_owner }}
4646

47+
- name: Setup git authentication for GitHub App
48+
env:
49+
GH_TOKEN: ${{ steps.app.outputs.token }}
50+
run: |
51+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
52+
4753
- name: Checkout repository
4854
uses: actions/checkout@v3
4955
with:
@@ -60,9 +66,7 @@ jobs:
6066
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6167

6268
- name: Clone build branch
63-
env:
64-
GH_TOKEN: ${{ steps.app.outputs.token }}
65-
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://${GH_TOKEN}@github.com/citusdata/packaging.git packaging
69+
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://github.com/citusdata/packaging.git packaging
6670

6771
- name: Install package dependencies
6872
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources

.github/workflows/citus-package-all-platforms-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ jobs:
4545
app-id: ${{ vars.GH_APP_ID }}
4646
private-key: ${{ secrets.GH_APP_KEY }}
4747

48+
- name: Setup git authentication for GitHub App
49+
env:
50+
GH_TOKEN: ${{ steps.app.outputs.token }}
51+
run: |
52+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
53+
4854
- name: Checkout repository
4955
uses: actions/checkout@v3
5056
with:

.github/workflows/package-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,20 @@ jobs:
3030
app-id: ${{ vars.GH_APP_ID }}
3131
private-key: ${{ secrets.GH_APP_KEY }}
3232
owner: citusdata
33+
34+
- name: Setup git authentication for GitHub App
35+
env:
36+
GH_TOKEN: ${{ steps.app.outputs.token }}
37+
run: |
38+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
39+
3340
- name: Checkout
3441
uses: actions/checkout@v3
3542
with:
3643
token: ${{ steps.app.outputs.token }}
3744
fetch-depth: 2
3845
submodules: true
39-
46+
4047
- name: Package version
4148
id: get-citus-version
4249
run: |

.github/workflows/packaging-methods-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
private-key: ${{ secrets.GH_APP_KEY }}
2424
owner: citusdata
2525

26+
- name: Setup git authentication for GitHub App
27+
env:
28+
GH_TOKEN: ${{ steps.app.outputs.token }}
29+
run: |
30+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
31+
2632
- name: Checkout repository
2733
uses: actions/checkout@v3
2834
with:

.github/workflows/publish-docker-image-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
private-key: ${{ secrets.GH_APP_KEY }}
2525
owner: citusdata
2626

27+
- name: Setup git authentication for GitHub App
28+
env:
29+
GH_TOKEN: ${{ steps.app.outputs.token }}
30+
run: |
31+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
32+
2733
- name: Checkout repository
2834
uses: actions/checkout@v3
2935
with:

.github/workflows/statistic-schedule.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
private-key: ${{ secrets.GH_APP_KEY }}
3737
owner: citusdata
3838

39+
- name: Setup git authentication for GitHub App
40+
env:
41+
GH_TOKEN: ${{ steps.app.outputs.token }}
42+
run: |
43+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
44+
3945
- name: Checkout repository
4046
uses: actions/checkout@v3
4147
with:

.github/workflows/statistic-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
private-key: ${{ secrets.GH_APP_KEY }}
3232
owner: citusdata
3333

34+
- name: Setup git authentication for GitHub App
35+
env:
36+
GH_TOKEN: ${{ steps.app.outputs.token }}
37+
run: |
38+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
39+
3440
- name: Checkout repository
3541
uses: actions/checkout@v3
3642
with:

.github/workflows/tool-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
private-key: ${{ secrets.GH_APP_KEY }}
3838
owner: citusdata
3939

40+
- name: Setup git authentication for GitHub App
41+
env:
42+
GH_TOKEN: ${{ steps.app.outputs.token }}
43+
run: |
44+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
45+
4046
- name: Checkout repository
4147
uses: actions/checkout@v3
4248
with:

packaging_automation/common_tool_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def initialize_env(exec_path: str, project_name: str, checkout_dir: str):
681681
remove_cloned_code(f"{exec_path}/{checkout_dir}")
682682
if not os.path.exists(checkout_dir):
683683
GH_TOKEN = os.environ.get("GH_TOKEN", "")
684-
run(f"git clone https://{GH_TOKEN}@github.com/citusdata/{project_name}.git {checkout_dir}")
684+
run(f"git clone https://github.com/citusdata/{project_name}.git {checkout_dir}")
685685

686686

687687
def create_pr(

packaging_automation/tests/test_citus_package.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,8 @@ def setup_module():
8686
"pgxn-citus" if PLATFORM == "pgxn" else PACKAGING_BRANCH_NAME
8787
)
8888
if not os.path.exists(PACKAGING_EXEC_FOLDER):
89-
GH_TOKEN = os.environ.get("GH_TOKEN", "")
90-
if not GH_TOKEN:
91-
raise ValueError("GH_TOKEN environment variable is not set.")
9289
run(
93-
f"git clone --branch {packaging_branch_name} https://{GH_TOKEN}@github.com/citusdata/packaging.git {PACKAGING_EXEC_FOLDER}"
90+
f"git clone --branch {packaging_branch_name} https://github.com/citusdata/packaging.git {PACKAGING_EXEC_FOLDER}"
9491
)
9592

9693

0 commit comments

Comments
 (0)