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

Add support for auto_merge and required_contexts #152

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gjtorikian
Copy link

@gjtorikian gjtorikian commented Jun 26, 2023

This PR extends the action to provide more configuration options when creating a deploy, by providing input support for auto_merge and required_contexts. More details can be found in the GitHub API docs: https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28#create-a-deployment

auto_merge is fairly straightforward. It is currently defaulting to false, and we can preserve that in this change for backwards compatibility.

required_contexts, on the other hand, has three states:

  1. ["test", "lint"], which is a specific list of contexts to run
  2. [], which ignores all the contexts
  3. undefined, which means, "run the default list of contexts"

Currently, required_contexts is set to []. In order to preserve backwards compatibility, users will have to pass an explicit "null" string for this input (supporting case 3). Omitting this input will skip all the required checks (case 2, the current case). Providing a multiline string covers case 1:

      with:
        required_contexts: |-
          test
          lint

@gjtorikian gjtorikian force-pushed the support-more-deployments-logic branch 8 times, most recently from 488ebbe to f257800 Compare June 28, 2023 18:36
@gjtorikian gjtorikian force-pushed the support-more-deployments-logic branch 2 times, most recently from 95c1256 to 962f8a1 Compare June 28, 2023 19:19
@gjtorikian gjtorikian force-pushed the support-more-deployments-logic branch from 962f8a1 to d8b71ed Compare June 28, 2023 19:22
@gjtorikian
Copy link
Author

I had to change the inputs logic a bit here:

  • "" or []: skip all required contexts
  • "*": require all (default) contexts
  • "test,lint": require the testandlint` contexts

halostatue added a commit to KineticCafe/deployments that referenced this pull request Feb 29, 2024
Changes were made to make the values cleaner and fix some incorrect
assumptions.
halostatue added a commit to KineticCafe/deployments that referenced this pull request Mar 4, 2024
Changes were made to make the values cleaner and fix some incorrect
assumptions.
halostatue added a commit to KineticCafe/deployments that referenced this pull request Mar 11, 2024
Adopted bobheadxi/deployments as KineticCafe/deployments, mostly to use
Node 20 as required by GitHub.

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/deployments@v1
```

We recommend using a more specific version tag:

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/[email protected]
```

- Switch from `npm` to `pnpm`

- Switch from `prettier` to `biome`.

- Upgrade to Typescript 5, @actions/github 6 and other dependencies.

- **Upgraded to use Node 20.**

- Apply bobheadxi#152 to allow required status contexts and
  auto merge.

  Changes were made to make the values cleaner and fix some incorrect
  assumptions.

- Apply bobheadxi/deploys#159 to add a warning when `delete-env` fails.

- Remove makefile

- Add a changelog file.
halostatue added a commit to KineticCafe/deployments that referenced this pull request Mar 11, 2024
Adopted bobheadxi/deployments as KineticCafe/deployments, mostly to use
Node 20 as required by GitHub.

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/deployments@v1
```

We recommend using a more specific version tag:

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/[email protected]
```

- Switch from `npm` to `pnpm`

- Switch from `prettier` to `biome`.

- Upgrade to Typescript 5, @actions/github 6 and other dependencies.

- **Upgraded to use Node 20.**

- Apply bobheadxi#152 to allow required status contexts and
  auto merge.

  Changes were made to make the values cleaner and fix some incorrect
  assumptions.

- Apply bobheadxi/deploys#159 to add a warning when `delete-env` fails.

- Remove makefile

- Add a changelog file.
halostatue added a commit to KineticCafe/deployments that referenced this pull request Mar 11, 2024
Adopted bobheadxi/deployments as KineticCafe/deployments, mostly to use
Node 20 as required by GitHub.

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/deployments@v1
```

We recommend using a more specific version tag:

```diff
- uses: bobheadxi/deployments@v1
+ uses: KineticCafe/[email protected]
```

- Switch from `npm` to `pnpm`

- Switch from `prettier` to `biome`.

- Upgrade to Typescript 5, @actions/github 6 and other dependencies.

- **Upgraded to use Node 20.**

- Apply bobheadxi#152 to allow required status contexts and
  auto merge.

  Changes were made to make the values cleaner and fix some incorrect
  assumptions.

- Apply bobheadxi/deploys#159 to add a warning when `delete-env` fails.

- Remove makefile

- Add a changelog file.
@bobheadxi
Copy link
Owner

Thanks for the contribution - if you're still interested in landing this, could you resolve the conflicts and remove the extraneous docs formatting changes? Thank you!

@gjtorikian gjtorikian force-pushed the support-more-deployments-logic branch from 6620363 to d64f1c4 Compare March 26, 2024 17:44
@gjtorikian gjtorikian force-pushed the support-more-deployments-logic branch from d64f1c4 to 5f3864a Compare March 26, 2024 17:45
@gjtorikian
Copy link
Author

Sure, I've done that, and run prettier.

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