Skip to content

Commit

Permalink
chore: update dependencies and text #1
Browse files Browse the repository at this point in the history
chore: update dependencies and text
  • Loading branch information
KyleTryon committed Dec 17, 2021
2 parents 35e66b8 + 63cb374 commit 8338648
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 347 deletions.
61 changes: 31 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# Trigger CircleCI Pipeline GitHub Action
Trigger your [CircleCI](https://circleci.com/) pipelines from any [event](https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows) on Github with [Github Actions](https://github.com/features/actions).
# Trigger CircleCI Pipeline

Trigger your [CircleCI](https://circleci.com/) pipelines from any [event](https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows) on GitHub with [GitHub Actions](https://github.com/features/actions).

# How to Use

1. Create a Github Action's workflow for the desired CircleCI pipeline.
1. Create a GitHub Action's workflow for the desired CircleCI pipeline.

Do this by adding a workflow YAML file (we'll use `main.yml`) to `./.github/workflows`.
Do this by adding a workflow YAML file (we'll use `main.yml`) to `./.github/workflows`.

A `release` trigger is shown in this example. Try any of the GitHub events for triggering workflows:
https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows


A `release` trigger is shown in this example. Try any of the Github events for triggering workflows:
https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows

Select a custom name and id for the step for additional contextual metadata in your CircleCI pipeline
Select a custom name and id for the step for additional contextual metadata in your CircleCI pipeline

```yaml
on:
Expand All @@ -34,29 +32,31 @@ jobs:

3. Add the [Pipeline Parameter](https://circleci.com/docs/2.0/pipeline-variables/) definitions to your CircleCI config. This data will be entered by the GitHub Action when triggered.

Add the following to the top of your `.circleci/config.yml` file. Ensure you are specifying version `2.1`

```yaml
version: 2.1
parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""
```
Add the following to the top of your `.circleci/config.yml` file. Ensure you are specifying version `2.1`

```yaml
version: 2.1
parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""
```

4. Use the Pipeline Parameter data to run [workflows conditionally](https://circleci.com/docs/2.0/pipeline-variables/#conditional-workflows).

**_See: [Examples](https://github.com/CircleCI-Public/trigger-circleci-pipeline-action/tree/main/examples)_**
**_See: [Examples](https://github.com/CircleCI-Public/trigger-circleci-pipeline-action/tree/main/examples)_**

# Inputs

Optional [input parameters](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs) that allow you to specify additional metadata.

### GHA_Meta
Expand All @@ -81,7 +81,8 @@ jobs:

# Things To Know

## GitHub Actions runs _along side_ native CircleCI integration.
## GitHub Actions runs _alongside_ native CircleCI integration.

By default, when a repository is connected to CircleCI, if the workflows within that project's configuration does not specify any conditionals or filters that would otherwise prevent execution, the workflow will execute on every `push` event by default.

This may mean it is possible to accidentally run a job twice, once on the `push` event from CircleCI, as well as other events triggered by the GitHub Action.
Expand All @@ -101,4 +102,4 @@ workflows:
test:
jobs:
- test
```
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Trigger CircleCI Pipeline GitHub Action'
name: 'Trigger CircleCI Pipeline'
description: 'Trigger pipelines on CircleCI for any event on GitHub.'
branding:
icon: "check-circle"
Expand Down
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7816,11 +7816,12 @@ function removeMatchingHeaders(regex, headers) {
var lastValue;
for (var header in headers) {
if (regex.test(header)) {
lastValue = headers[header].toString().trim();
lastValue = headers[header];
delete headers[header];
}
}
return lastValue;
return (lastValue === null || typeof lastValue === "undefined") ?
undefined : String(lastValue).trim();
}

function createErrorType(code, defaultMessage) {
Expand Down Expand Up @@ -9240,7 +9241,7 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
});

const INTERNALS$2 = Symbol('Request internals');
const URL = whatwgUrl.URL;
const URL = Url.URL || whatwgUrl.URL;

// fix an issue where "format", "parse" aren't a named export for node <10
const parse_url = Url.parse;
Expand Down
Loading

0 comments on commit 8338648

Please sign in to comment.