DEV Community

Outvi V
Outvi V

Posted on

Asset download, upload and metadata update all in one

My Workflow

This actions is designed to, with the help of a GitHub bot:

  • Accept clip and metadata input from a comment in issues
  • Clip the asset according to the comment
  • Download the asset and put it in the correct location (here begin the action part)
  • Fill in the metadata
  • Make a commit and push as a PR

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

name: "Auto PR for new sound"

    types: [created, edited]

    name: Create a PR with the sound
    if: "(contains(github.event.comment.body, ' pr ')) && ((contains(github.event.comment.author_association, 'OWNER') || contains(github.event.comment.user.login, 'librehsbot')) && (github.event.issue.number == 1))"
    runs-on: ubuntu-18.04
      - uses: actions/checkout@v2
        name: Check out current commit

      - uses: suisei-cn/actions-download-file@v1
        id: downloadfile
        name: Download the file
          url: ${{ github.event.comment.body }}
          target: assets
          auto-match: true

      - uses: suisei-cn/actions-update-metadata@v2
        id: updatemeta
        name: Update sounds.yml
          comment: ${{ github.event.comment.body }}
          target: sounds.yml
          default-username: librehsbot
          format: yaml

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v2.8.0
          committer: Suisei Bot <>
          author: ${{ steps.updatemeta.outputs.username }} <${{ steps.updatemeta.outputs.username }}>
          commit-message: "feat(sound): Add ${{ steps.downloadfile.outputs.filename }}"
          title: "feat(sound): Add ${{ steps.downloadfile.outputs.filename }}"
          body: |
            This is an automated sound addition PR. Netlify preview should be available soon, and a preview link should be shown.

            <sub>Having problems? Check your [workflow](</sub>
          branch: sound/new
          branch-suffix: "random"
          labels: new-sound


GitHub logo suisei-cn / sbtn-assets

Starbuttons assets.

Additional Resources / Info

Top comments (0)