Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/npm-development-8b3b…
Browse files Browse the repository at this point in the history
…70ae65
  • Loading branch information
Baraujo25 committed Nov 21, 2024
2 parents 8d4c0e3 + b8b1766 commit 265111e
Show file tree
Hide file tree
Showing 18 changed files with 4,563 additions and 484 deletions.
11 changes: 9 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ ACTIONS_STEP_DEBUG=true

# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
# Hyphens should not be converted to underscores!
INPUT_MILLISECONDS=2400

#INPUT_UPSTREAM-REPOSITORY=https://github.com/abstracta/jmeter-plugins.git
#INPUT_FORKED-REPOSITORY=https://github.com/abstracta/jmeter-plugins.git
#INPUT_PLUGIN-ARTIFACT-NAME=jmeter-bzm-correlation-recorder
#INPUT_PLUGIN-ID=bzm-siebel
#INPUT_CHANGES="New Release"
#INPUT_IGNORE-DEPENDENCIES=bzm-repositories

# GitHub Actions default environment variables. These are set for every run of a
# workflow and can be used in your actions. Setting the value here will override
# any value set by the local-action tool.
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

# CI="true"
# GITHUB_TOKEN=""
# GITHUB_ACTION=""
# GITHUB_ACTION_PATH=""
# GITHUB_ACTION_REPOSITORY=""
Expand All @@ -35,7 +42,7 @@ INPUT_MILLISECONDS=2400
# GITHUB_REF_NAME=""
# GITHUB_REF_PROTECTED=""
# GITHUB_REF_TYPE=""
# GITHUB_REPOSITORY=""
# GITHUB_REPOSITORY="Blazemeter/CorrelationRecorder"
# GITHUB_REPOSITORY_ID=""
# GITHUB_REPOSITORY_OWNER=""
# GITHUB_REPOSITORY_OWNER_ID=""
Expand Down
18 changes: 0 additions & 18 deletions .github/linters/.markdown-lint.yml

This file was deleted.

19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,19 @@ jobs:
id: test-action
uses: ./
with:
milliseconds: 2000
upstream-repository: https://github.com/Abstracta/jmeter-plugins.git
forked-repository: https://github.com/Abstracta/jmeter-plugins.git
plugin-artifact-name: jmeter-bzm-correlation-recorder
plugin-id: bzm-siebel
changes: some changes
token: ${{ secrets.GH_TOKEN }}
env:
TEST_GITHUB_REPOSITORY: 'Blazemeter/CorrelationRecorder'

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
- name: Print PR link
run: echo "${{ steps.test-action.outputs.pull_request }}"

- name: Delete PR
run: gh pr close ${{ steps.test-action.outputs.pull_request }} --delete-branch
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,3 @@ __tests__/runner/*
# IDE files
.idea
*.code-workspace

# Ignore Boundle Artifacts
dist/*
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Publish JMeter Plugin Action

This GitHub Action automates the process of publishing a plugin to the
[JMeter Plugins Manager repository](https://github.com/undera/jmeter-plugins). It generates the
required metadata from the latest GitHub release of your plugin and creates a pull request to the
target repository.
[JMeter Plugins Manager repository](https://github.com/undera/jmeter-plugins).

It generates the required metadata from the latest GitHub release of your plugin and creates a pull
request to the target repository.

## Features

Expand All @@ -18,13 +19,21 @@ The action requires the following inputs:

| Input | Description | Required | Default |
| ---------------------- | -------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------- |
| `upstream-repository` | URL of the target JMeter Plugins repository to send the PR to. | No | `https://github.com/undera/jmeter-plugins.git` |
| `token` | GitHub token used for authentication to perform API operations such as fetching assets and creating PRs. | Yes | - |
| `forked-repository` | URL of your forked repository used to send the PR from. | Yes | - |
| `plugin-artifact-name` | Prefix of the plugin artifact name used to identify the JAR file in the GitHub release. | Yes | - |
| `plugin-id` | Registered ID for identifying the plugin in the JMeter Plugins repository. | Yes | - |
| `plugin-artifact-name` | Prefix of the plugin artifact name used to identify the JAR file in the GitHub release. | Yes | - |
| `changes` | Release note line describing the update. | Yes | - |
| `ignore-dependencies` | Comma-separated prefixes of dependencies to ignore in the release metadata. | No | - |
| `token` | GitHub token used for authentication to perform API operations such as fetching assets and creating PRs. | Yes | - |
| `upstream-repository` | URL of the target JMeter Plugins repository to send the PR to. | No | `https://github.com/undera/jmeter-plugins.git` |

## Outputs

The action throws a single output:

| Output | Description |
| -------------- | ---------------------------------------------------------------- |
| `pull_request` | URL of the generated Pull Request into the `upstream-repository` |

## Usage

Expand All @@ -45,24 +54,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run Publish JMeter Plugin Action
uses: abstracta/publish-jmeter-plugin@v1
id: publish-plugin
uses: abstracta/jmeter-plugin-publish-action@main
with:
forked-repository: https://github.com/Abstracta/jmeter-plugins.git
plugin-artifact-name: prefix-of-example-plugin-name
plugin-id: example-plugin-id
changes: ${{ inputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Print Pull Request URL
run: echo ${{ steps.publish-plugin.outputs.pull_request }}
```
## How It Works
1. _Input Validation_: The action ensures all required inputs are provided.
1. _Repository Setup_: It checks out the forked repository and configures upstream and origin
1. **Input Validation**: The action ensures all required inputs are provided.
1. **Repository Setup**: It checks out the forked repository and configures upstream and origin
remotes.
1. _Metadata Generation_: Extracts version and library details from the latest GitHub release of the
plugin.
1. _Update_: Locates the correct section using plugin-id and appends the new release details.
1. _Branching and PR_: Creates a new release branch, commits the changes, and pushes the branch to
1. **Metadata Generation**: Extracts version and library details from the latest GitHub release of
the plugin.
1. **Update**: Locates the correct section using plugin-id and appends the new release details.
1. **Branching and PR**: Creates a new release branch, commits the changes, and pushes the branch to
the forked repository. A pull request is then created to the upstream repository using the
`token`.

Expand Down
8 changes: 5 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ name: 'JMeter Plugin Publish'
description: 'Automatically publish JMeter Plugin into JMeter Plugins Manager repository'
author: 'Abstracta'

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
icon: git-pull-request
color: 'red'

# Define your inputs here.
inputs:
upstream-repository:
description: 'Url of target jmeter-plugins repository'
Expand Down Expand Up @@ -36,6 +34,10 @@ inputs:
jmeter-plugins release but are present in github release"
required: false

outputs:
pull_request:
description: 'The url of the created PR for review and draft change'

runs:
using: node20
main: dist/index.js
1 change: 0 additions & 1 deletion badges/coverage.svg

This file was deleted.

Loading

0 comments on commit 265111e

Please sign in to comment.