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

ci: fix documentation manual dispatch run on tag #10007

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

Qjuh
Copy link
Contributor

@Qjuh Qjuh commented Nov 30, 2023

Please describe the changes this PR makes and why it should be merged:

have manual runs of documentation workflow work as expected, emitting .api.json files for the selected tag/branch

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@Qjuh Qjuh requested a review from iCrawl as a code owner November 30, 2023 21:12
Copy link

vercel bot commented Nov 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Nov 30, 2023 9:13pm
discord-js-guide ⬜️ Ignored (Inspect) Nov 30, 2023 9:13pm

@Jiralite Jiralite added the ci label Nov 30, 2023
@@ -61,14 +61,14 @@ jobs:
path: 'out'

- name: Extract package and semver from tag
if: ${{ github.ref_type == 'tag' }}
if: ${{ inputs.ref_type && inputs.ref_type == 'tag' || !inputs.ref_type && github.ref_type == 'tag' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simplify these to just?

Suggested change
if: ${{ inputs.ref_type && inputs.ref_type == 'tag' || !inputs.ref_type && github.ref_type == 'tag' }}
if: ${{ inputs.ref_type == 'tag' || github.ref_type == 'tag' }}

Copy link
Contributor Author

@Qjuh Qjuh Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that would be true if inputs.ref_type was 'branch' but github.ref_type was 'tag'. Which is not what we'd want (more prominent in the other way around, since manual workflow runs would seldom be from a tag but a branch).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you got an easier way to say "if manual run the inputs.ref_type decides what to run, if PR or push the github.ref_type does" I'm all ears.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that would be true if inputs.ref_type was 'branch' but github.ref_type was 'tag'.

And how is that an issue? inputs takes priority, since its a manual run, and won't be present on the other possible on triggers 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also just extract this in a variable on a separate workflow step, that would probably simplify the logic and also help keep the decision on what to run in one central place

@iCrawl iCrawl merged commit fe90487 into discordjs:main Nov 30, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants