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

Feature request: updating Deno version in GitHub actions #49

Open
harrysolovay opened this issue Jan 1, 2022 · 6 comments
Open

Feature request: updating Deno version in GitHub actions #49

harrysolovay opened this issue Jan 1, 2022 · 6 comments

Comments

@harrysolovay
Copy link

Huge fan of this project!

Was wondering if you'd consider extending its functionality to cover Deno version text in non-TS files (in particular GitHub actions).

name: Test
on:
  pull_request:
    branches:
      - "*"
jobs:
  test:
    name: Test
    strategy:
      matrix:
        os: [ubuntu-20.04, macos-11.0, windows-2019]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: denoland/setup-deno@main
        with:
          deno-version: v1.17.1 # <--
      - run: scripts/test.ts

I'd understand if this is out of scope, as there's no generalized & obvious way to identify some version text as a Deno version. Perhaps it could apply––at first––only to denoland/setup-deno jobs.

Thank you for your consideration!

@hayd
Copy link
Owner

hayd commented Jan 3, 2022

My understanding is that the problem is that GitHub actions don't run CI actions if you edit .github/ directory.

I am open to this, and I think it would be really nice.. I just don't know the best workaround to that.

One possibility is that a DENO_VERSION file could be in the top directory and the action read that? (ideally setup-deno could support that OOTB...) 😬

@hayd
Copy link
Owner

hayd commented Jan 3, 2022

I guess this needs some investigation into what the actual situation is (the above is from my memory), but certainly happy to include something like this to udd if we can get it to work!

We can get the latest deno version(s) using existing udd machinery.

@harrysolovay
Copy link
Author

My understanding is that the problem is that GitHub actions don't run CI actions if you edit .github/ directory.

So merging workflow-updating PRs would not result in a run of that workflow? Is this the issue? & is this necessarily bad?

If so, the feature could live behind an --unsafe flag. --unsafe='update-gh-workflows' would do the trick for now––for users who don't mind the potential for action-related difficulties.

What're your thoughts?

@hayd
Copy link
Owner

hayd commented Jan 12, 2022

So merging workflow-updating PRs would not result in a run of that workflow? Is this the issue? & is this necessarily bad?

Oh, no, I wasn't clear here, this is for the scheduled action: if you use create-pull-request action (similar to udd.yml ) then if your code edits .github/ then other all ci actions will not run (until you close/reopen the PR).
Edit: Actually maybe this is just always the case - for all scheduled actions - you need to close and reopen to run CI. 🤔

I don't think we need the --unsafe flag, just something like --github-actions or something.

@hayd
Copy link
Owner

hayd commented Jan 20, 2022

Note: This is how this is done in deno-lambda: https://github.com/hayd/deno-lambda/blob/eedcbb77e97cd30d4eef6f94bcd5639b1172158d/.github/workflows/bump.yml#L23

  • locate existing deno-version
  • get latest version (from setup deno)
  • sed to do the replace (if just doing deno-version= lines in .github/workflows this should be cleaner/can be more explicit)
  • if different creates PR

@harrysolovay
Copy link
Author

That's a nice trick––thank you for sharing!

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

No branches or pull requests

2 participants