Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch data from heckdivers-json github repo. #4

Merged
merged 2 commits into from
May 7, 2024
Merged

Conversation

ashortsleeves
Copy link
Owner

Data is pulled from: https://github.com/ashortsleeves/heckdivers-json

Below is the github action to update that repo every ~10 minutes.

name: Update Campaigns Data

on:
  push:
  workflow_dispatch:
  schedule:
    - cron:  '*/10 * * * *'

jobs:
  scheduled:
    runs-on: ubuntu-latest
    steps:
    - name: Check out this repo
      uses: actions/checkout@v4
      with:
        fetch-depth: 1440

    - name: Fetch Campaigns Data
      run: |-
        curl -X GET \
          -H "X-Super-Client: Heckdivers-local" \
          -H "X-Super-Contact: gh/ashortsleeves-local" \
          -o campaigns.json \
          https://api.helldivers2.dev/api/v1/campaigns
        curl -X GET \
          -H "X-Super-Client: Heckdivers-local" \
          -H "X-Super-Contact: gh/ashortsleeves-local" \
          -o assignments.json \
          https://api.helldivers2.dev/api/v1/assignments
        curl -X GET \
          -H "X-Super-Client: Heckdivers-local" \
          -H "X-Super-Contact: gh/ashortsleeves-local" \
          -o newsfeed.json \
          https://api.helldivers2.dev/raw/api/NewsFeed/801

    - name: Commit and push if it changed
      run: |-
        git config user.name "Automated"
        git config user.email "actions@users.noreply.github.com"
        git add campaigns.json
        git add assignments.json
        git add newsfeed.json
        timestamp=$(date -u)
        git commit -m "Latest data: ${timestamp}" || exit 0
        git push

Copy link

netlify bot commented May 7, 2024

Deploy Preview for heckdivers ready!

Name Link
🔨 Latest commit ffb082c
🔍 Latest deploy log https://app.netlify.com/sites/heckdivers/deploys/663a7a6bcd036b000817cd15
😎 Deploy Preview https://deploy-preview-4--heckdivers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dealloc
Copy link

dealloc commented May 7, 2024

don't forget to remove the -local prefix :)
we'll remove you from the blacklist once this merges (might be good to sync those deploys)

@ashortsleeves
Copy link
Owner Author

don't forget to remove the -local prefix :) we'll remove you from the blacklist once this merges (might be good to sync those deploys)

Will do! I'll merge this now and remove the -local prefix.

@ashortsleeves ashortsleeves merged commit b4ee238 into maestro May 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants