Skip to content

Commit 2d18ef3

Browse files
workflows/ci (#16)
* Update CI * Update CI * Wrap translations * Update CI * Update CI * Update CI * Update CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Wrap translations * Test * Test * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Modify CI * Wrap translations * Ready for PR Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 47a0db5 commit 2d18ef3

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.github/workflows/get-changes.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import requests
2+
import json
3+
from argparse import ArgumentParser
4+
5+
parser = ArgumentParser()
6+
parser.add_argument("--pull", help="PR Number ${{ github.event.number }}")
7+
args = parser.parse_args()
8+
9+
response = requests.get(
10+
f"https://api.github.com/repos/python-docs-tr/python-docs-tr/pulls/{args.pull}/files"
11+
)
12+
13+
response = json.loads(response.text)
14+
15+
for number in range(len(response)):
16+
print(response[number]["filename"])

.github/workflows/wrap.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: "Wrap"
22

33
on:
4-
pull_request:
4+
pull_request:
55
branches: [ "**" ]
66

7-
jobs:
8-
test:
7+
jobs:
8+
wrap:
99
runs-on: ubuntu-latest
1010

1111
strategy:
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 0
22+
ref: ${{ github.event.pull_request.head.ref }}
2223

2324
# Setup which version of Python to use
2425
- name: Set Up Python ${{ matrix.python-version }}
@@ -44,7 +45,7 @@ jobs:
4445

4546
# Detect changed files
4647
- name: Detect changed files
47-
run: echo "CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | tr '\n' ' ')" >> $GITHUB_ENV
48+
run: echo "CHANGED_FILES=$(python .github/workflows/get-changes.py --pull ${{ github.event.pull_request.number }} | tr '\n' ' ')" >> $GITHUB_ENV
4849

4950
# Wrap changed files
5051
- name: Wrap
@@ -89,4 +90,4 @@ jobs:
8990
uses: ad-m/github-push-action@master
9091
with:
9192
github_token: ${{ secrets.GITHUB_TOKEN }}
92-
branch: ${{ github.event.pull_request.head.ref }}
93+
branch: ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)