Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanu authored Feb 28, 2024
1 parent 9b33daa commit e54489d
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,16 @@ jobs:
API_URL_TOP_REFERRERS="https://api.github.com/repos/${{ github.repository }}/traffic/popular/referrers"
API_URL_VIEWS="https://api.github.com/repos/${{ github.repository }}/traffic/views"
AUTH_HEADER="Authorization: token ${{ secrets.PAT }}"
curl -sSL -H "${AUTH_HEADER}" "${API_URL_CLONES}" > clones.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_TOP_PATHS}" > top_paths.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_TOP_REFERRERS}" > top_referrers.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_VIEWS}" > views.json
- name: Move JSON files to repository
run: |
mkdir -p traffic_data
mv clones.json top_paths.json top_referrers.json views.json traffic_data/
- name: Display traffic data
run: |
cat clones.json
cat top_paths.json
cat top_referrers.json
cat views.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_CLONES}" > traffic_data/clones.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_TOP_PATHS}" > traffic_data/top_paths.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_TOP_REFERRERS}" > traffic_data/top_referrers.json
curl -sSL -H "${AUTH_HEADER}" "${API_URL_VIEWS}" > traffic_data/views.json
# - name: Save traffic data to artifacts
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: traffic-data
# path: traffic.json
- name: Commit and push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.PAT }}
branch: main
directory: traffic_data
message: Update traffic data

0 comments on commit e54489d

Please sign in to comment.