robotpy / pyfrc

python3 library designed to make developing RobotPy-based code easier!
MIT License
50 stars 35 forks source link

Add Github Action to bump requirements #165

Closed TheTripleV closed 4 years ago

TheTripleV commented 4 years ago

Functionality:

When this repo receives a webhook with a package name and repo name:

  1. Get the latest tag at the repo
  2. Check tag against current version in requirements.txt
  3. Update requirements.txt
  4. Commit, Push, Tag, Push

Notes:

virtuald commented 4 years ago

Uses this? https://github.com/marketplace/actions/repository-dispatch

TheTripleV commented 4 years ago

No. On the other end, I've been using a POST

        curl -X POST https://api.github.com/repos/robotpy/pyfrc/dispatches \
            -H 'Accept: application/vnd.github.everest-preview+json' \
            -u TheTripleV:${{ secrets.PYFRC_ACCESS_TOKEN }} \
            --data '{"event_type": "tag", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'", "package_name": "wpilib"}}'

but i guess that would work too. I'll try it out. That shouldn't affect this side of the script though.

TheTripleV commented 4 years ago

repository-dispatch isn't working for me: My yaml

    - name: Ping pyfrc
      uses: peter-evans/repository-dispatch@v1
      with:
        token: ${{ secrets.PYFRC_ACCESS_TOKEN }}
        repository: TheTripleV/pyfrc
        event-type: tag
        client-payload: '{"repository": "'"$GITHUB_REPOSITORY"'", "package_name": "wpilib"}}'

Github Actions is throwing a yaml syntax error on the event-type line.

TheTripleV commented 4 years ago

Yes, now it does use https://github.com/marketplace/actions/repository-dispatch on the sending side.

virtuald commented 4 years ago

Hm, can't the sending repo send this the tag? Then it doesn't need to check the repo out.

virtuald commented 4 years ago

Thanks!

virtuald commented 4 years ago

I've added a REPO_ACCESS_TOKEN secret to the relevant repos.