Skip to content

Commit 12d25b8

Browse files
authored
Revert "chore(IDX): simplify repo policies workflow (#106)" (#107)
This reverts commit b8cf1e7.
1 parent b8cf1e7 commit 12d25b8

File tree

2 files changed

+52
-43
lines changed

2 files changed

+52
-43
lines changed

.github/workflows/repo_policies.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Repository Policies
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
check-bot-policies:
8+
name: Check Bot Policies
9+
runs-on: ubuntu-latest
10+
# Dont run this workflow on merge queue
11+
if: ${{ github.event_name != 'merge_group' }}
12+
steps:
13+
# First check out code from public-workflows
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
repository: dfinity/public-workflows
18+
path: public-workflows
19+
20+
# Then switch back to this repository to make sure it's run from current
21+
- name: Checkout Original Repository
22+
uses: actions/checkout@v4
23+
with:
24+
path: current-repo # need to specify another path to avoid overwriting the first checkout
25+
repository: ${{ github.event.pull_request.head.repo.full_name }}
26+
ref: ${{ github.head_ref }}
27+
fetch-depth: 50
28+
29+
- name: Python Setup
30+
uses: ./public-workflows/.github/workflows/python-setup
31+
with:
32+
working-directory: public-workflows
33+
34+
- name: Bot Checks
35+
id: bot-checks
36+
run: |
37+
set -euo pipefail
38+
export PYTHONPATH="$PWD/public-workflows/reusable_workflows/"
39+
python public-workflows/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py
40+
shell: bash
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GH_ORG: ${{ github.repository_owner }}
44+
USER: ${{ github.event.pull_request.user.login }}
45+
REPO: ${{ github.event.repository.name }}
46+
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
47+
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
48+
REPO_PATH: current-repo
+4-43
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# triggered on all repositories that use the PR creation Bot
1+
# triggered on all repositories via rulesets
22

33
name: Repo Policies Ruleset
44

@@ -7,45 +7,6 @@ on:
77
merge_group:
88

99
jobs:
10-
check-bot-policies:
11-
name: Check Bot Policies
12-
runs-on: ubuntu-latest
13-
# Dont run this workflow on merge queue
14-
if: ${{ github.event_name != 'merge_group' }}
15-
steps:
16-
# First check out code from public-workflows
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
with:
20-
repository: dfinity/public-workflows
21-
path: public-workflows
22-
23-
# Then switch back to this repository to make sure it's run from current
24-
- name: Checkout Original Repository
25-
uses: actions/checkout@v4
26-
with:
27-
path: current-repo # need to specify another path to avoid overwriting the first checkout
28-
repository: ${{ github.event.pull_request.head.repo.full_name }}
29-
ref: ${{ github.head_ref }}
30-
fetch-depth: 50
31-
32-
- name: Python Setup
33-
uses: ./public-workflows/.github/workflows/python-setup
34-
with:
35-
working-directory: public-workflows
36-
37-
- name: Bot Checks
38-
id: bot-checks
39-
run: |
40-
set -euo pipefail
41-
export PYTHONPATH="$PWD/public-workflows/reusable_workflows/"
42-
python public-workflows/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py
43-
shell: bash
44-
env:
45-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
GH_ORG: ${{ github.repository_owner }}
47-
USER: ${{ github.event.pull_request.user.login }}
48-
REPO: ${{ github.event.repository.name }}
49-
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
50-
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
51-
REPO_PATH: current-repo
10+
call-repo-policies:
11+
uses: dfinity/public-workflows/.github/workflows/repo_policies.yml@main
12+
secrets: inherit

0 commit comments

Comments
 (0)