Skip to content

백준 1330번 두 수 비교하기 #95

백준 1330번 두 수 비교하기

백준 1330번 두 수 비교하기 #95

name: CI
on:
push:
branches: [ master ]
jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: get repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: get path of main.py
shell: bash
run: |
echo "path_of_main_py=$(git diff --name-only HEAD~1 HEAD | grep '/main\.py')" >> $GITHUB_ENV
- name: Check main.py exists
shell: bash
run: |
if [ -z ${{ env.path_of_main_py }} ]; then
echo "No main.py exists"
exit 1
fi
- name: Get first line of last commit message
shell: bash
run: |
echo "one_line=$(git log --oneline -n 1 --format=%B | head -n 1)" >> $GITHUB_ENV
- name: Decorate path_of_main_py
shell: bash
env:
BITLY_PAT: ${{ secrets.BITLY_PAT }}
run: |
echo "path_of_main_py=https://github.com/skysign/WSAPT/blob/master/${{ env.path_of_main_py }}" >> $GITHUB_ENV
echo "${{ env.path_of_main_py }}"
- name: Create bit.ly short url
env:
BITLY_PAT: ${{ secrets.BITLY_PAT }}
shell: bash
run: |
curl \
-H "Authorization: Bearer ${{ env.BITLY_PAT }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{"long_url": "${{ env.path_of_main_py }}", "title": "${{ env.one_line }}"}' \
https://api-ssl.bitly.com/v4/bitlinks