Skip to content

Commit fb1e1ae

Browse files
authored
Update main_py_to_bitly.yml
1 parent fd00538 commit fb1e1ae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/main_py_to_bitly.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,33 @@
1111
with:
1212
fetch-depth: 2
1313
- name: get path of main.py
14+
shell: bash
1415
run: |
1516
echo "path_of_main_py=$(git diff --name-only HEAD~1 HEAD | grep '/main\.py')" >> $GITHUB_ENV
1617
- name: Check main.py exists
18+
shell: bash
1719
run: |
1820
if [ -z ${{ env.path_of_main_py }} ]; then
1921
echo "No main.py exists"
2022
exit 1
2123
fi
2224
- name: Decorate path_of_main_py
23-
run: echo "path_of_main_py=https://github.com/skysign/WSAPT/blob/master/${{ env.path_of_main_py }}" >> $GITHUB_ENV
24-
- name: Print path_of_main_py
25-
run: echo "${{ env.path_of_main_py }}"
25+
shell: bash
26+
run: |
27+
echo "path_of_main_py=https://github.com/skysign/WSAPT/blob/master/${{ env.path_of_main_py }}" >> $GITHUB_ENV
28+
echo "${{ env.path_of_main_py }}"
29+
- name: Get bitly-pat
30+
shell: bash
31+
id: get-bitly-pat
32+
run: |
33+
echo "BITLY_PAT=${{ secrets.BITLY_PAT }}" >> $GITHUB_OUTPUT
2634
- name: Create bit.ly short url
2735
shell: bash
2836
env:
2937
bitly_pat: ${{ secrets.BITLY_PAT }}
3038
run: |
3139
curl \
32-
-H "Authorization: ${{ env.bitly_pat }}" \
40+
-H "Authorization: ${{ steps.get-bitly-pat.outputs.BITLY_PAT }}" \
3341
-H "Content-Type: application/json" \
3442
-X POST \
3543
-d '{"long_url": "${{ env.path_of_main_py }}"}' \

0 commit comments

Comments
 (0)