Skip to content

Commit d8a730a

Browse files
committed
Update Workflows
1 parent 99cdb9e commit d8a730a

File tree

7 files changed

+94
-47
lines changed

7 files changed

+94
-47
lines changed

.github/workflows/lint.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Lint"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [master]
8+
9+
jobs:
10+
lint:
11+
name: "Lint"
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: actions/checkout@v4
18+
19+
#- name: "Debug event.json"
20+
# run: |
21+
# cat "${GITHUB_EVENT_PATH}"
22+
23+
- name: "ShellCheck"
24+
if: ${{ always() }}
25+
uses: ludeeus/action-shellcheck@master
26+
with:
27+
scandir: "src"
28+
check_together: "yes"
29+
30+
- name: "Prettier"
31+
if: ${{ always() }}
32+
run: |
33+
npm install prettier
34+
npx prettier --check .

.github/workflows/release.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Release"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: "Release"
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: "Update Tags"
17+
uses: cssnr/update-version-tags-action@v1

.github/workflows/tags.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: "Tags"
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Target Tag"
8+
required: true
69

710
jobs:
811
tags:
912
name: "Tags"
1013
runs-on: ubuntu-latest
1114
timeout-minutes: 5
15+
permissions:
16+
contents: write
1217

1318
steps:
1419
- name: "Update Tags"
1520
uses: cssnr/update-version-tags-action@v1
1621
with:
17-
token: ${{ secrets.GITHUB_TOKEN }}
22+
tag: ${{ inputs.tag }}
23+
token: ${{ secrets.GH_PAT }}

.github/workflows/test.yaml

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: "Test"
22

3-
# NOTE: Job test mirror's the action so there is no mirror.yaml workflow...
3+
# TODO: This job mirror's the repository so there is no mirror.yaml. Overhaul this workflow...
44

55
on:
66
workflow_dispatch:
7-
release:
8-
types: ["published"]
97
push:
108
branches: ["**"]
119
tags: ["**"]
@@ -33,18 +31,3 @@ jobs:
3331
create: true
3432
username: shaner
3533
password: ${{ secrets.CODEBERG_TOKEN }}
36-
37-
lint:
38-
name: "Lint"
39-
runs-on: ubuntu-latest
40-
timeout-minutes: 5
41-
42-
steps:
43-
- name: "Checkout"
44-
uses: actions/checkout@v4
45-
46-
- name: "Run ShellCheck"
47-
uses: ludeeus/[email protected]
48-
with:
49-
scandir: "src"
50-
check_together: "yes"

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# IDE
2+
.idea/
3+
.vscode/
4+
5+
# Tools
6+
.ruff_cache/
7+
.mypy_cache/
8+
.pytest_cache/

README.md

+25-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Tags](https://img.shields.io/github/actions/workflow/status/cssnr/mirror-repository-action/tags.yaml?logo=github&logoColor=white&label=tags)](https://github.com/cssnr/mirror-repository-action/actions/workflows/tags.yaml)
22
[![Test](https://img.shields.io/github/actions/workflow/status/cssnr/mirror-repository-action/test.yaml?logo=github&logoColor=white&label=test)](https://github.com/cssnr/mirror-repository-action/actions/workflows/test.yaml)
3+
[![Lint](https://img.shields.io/github/actions/workflow/status/cssnr/mirror-repository-action/lint.yaml?logo=github&logoColor=white&label=lint)](https://github.com/cssnr/mirror-repository-action/actions/workflows/lint.yaml)
34
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_mirror-repository-action&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cssnr_mirror-repository-action)
45
[![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/mirror-repository-action?logo=github)](https://github.com/cssnr/mirror-repository-action/releases/latest)
56
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/mirror-repository-action?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/mirror-repository-action/graphs/commit-activity)
@@ -10,25 +11,25 @@
1011

1112
# Mirror Repository Action
1213

13-
Mirror Git Repository to Remote Host.
14-
1514
- [Inputs](#Inputs)
1615
- [Setup Instructions](#Setup-Instructions)
1716
- [Example](#Example)
1817
- [Support](#Support)
1918
- [Contributing](#Contributing)
2019

20+
Mirror Git Repository to Remote Host.
21+
2122
## Inputs
2223

23-
| input | required | default | description |
24-
| -------- | ------------- | ---------- | -------------------------------------------------------- |
25-
| url | Not w/ `host` | - | \* Full URL to Mirror, overrides: `host`/`owner`/`repo` |
26-
| host | Not w/ `url` | - | \* Full Host to Mirror, example: `https://codeberg.org` |
27-
| owner | No | Repo Owner | \* Repository Owner of Mirror (if different from source) |
28-
| repo | No | Repo Name | \* Repository Name of Mirror (if different from source) |
29-
| create | No | - | \* Set to `true` to attempt to Create the Mirror Repo |
30-
| username | No | Repo Owner | Username for Authentication to Mirror |
31-
| password | Yes | - | Token or Password for Authentication to Mirror |
24+
| input | required | default | description |
25+
| -------- | :-------: | ---------- | -------------------------------------------------------- |
26+
| url | or `host` | - | \* Full URL to Mirror, overrides: `host`/`owner`/`repo` |
27+
| host | or `url` | - | \* Full Host to Mirror, example: `https://codeberg.org` |
28+
| owner | - | Repo Owner | \* Repository Owner of Mirror (if different from source) |
29+
| repo | - | Repo Name | \* Repository Name of Mirror (if different from source) |
30+
| create | - | - | \* Set to `true` to attempt to Create the Mirror Repo |
31+
| username | - | Repo Owner | Username for Authentication to Mirror |
32+
| password | **Yes** | - | Token or Password for Authentication to Mirror |
3233

3334
**url/host** - You must provide either a full repository `url` or a `host` value.
3435

@@ -43,7 +44,7 @@ Mirror Git Repository to Remote Host.
4344
- Codeberg/Gitea/Forgejo go here: https://codeberg.org/user/settings/applications
4445
- Select Permissions: `write:organization` `write:repository` `write:user`
4546

46-
2. Create Remote Repository to Mirror, or set `create` to `true`, for example: `https://codeberg.org`
47+
2. Create Remote Repository to Mirror (or set `create` to `true` for codeberg.org).
4748

4849
3. Go to the settings for your source repository on GitHub and add the `CODEBERG_TOKEN` secret.
4950

@@ -53,7 +54,7 @@ Mirror Git Repository to Remote Host.
5354

5455
- The `owner` is automatically set to the GitHub Organization or Username if personal. Set to override.
5556
- The `repo` is automatically set to the GitHub Repository Name. This should only be set to rename repo.
56-
- For Codeberg, use the `host` below and set the `username` to your Codeberg username.
57+
- For Codeberg, use the `host` to `https://codeberg.org` and set the `username` to your Codeberg username.
5758

5859
## Example
5960

@@ -64,8 +65,6 @@ name: 'Mirror'
6465

6566
on:
6667
workflow_dispatch:
67-
release:
68-
types: ['published']
6968
push:
7069
branches: ['**']
7170
tags: ['**']
@@ -109,21 +108,23 @@ If you are experiencing an issue/bug or getting unexpected results, you can:
109108
- Report an Issue: https://github.com/cssnr/mirror-repository-action/issues
110109
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
111110
- Provide General
112-
Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback/?app=Mirror%20Artifacts%20Action)
111+
Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback/?app=Mirror%20Repository%20Action)
113112

114113
# Contributing
115114

116115
Currently, the best way to contribute to this project is to star this project on GitHub.
117116

118117
Additionally, you can support other GitHub Actions I have published:
119118

120-
- [VirusTotal Action](https://github.com/cssnr/virustotal-action)
121-
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action)
122-
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action)
123-
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action)
124-
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action)
125-
- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action)
126-
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action)
127-
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action)
119+
- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action?tab=readme-ov-file#readme)
120+
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#readme)
121+
- [VirusTotal Action](https://github.com/cssnr/virustotal-action?tab=readme-ov-file#readme)
122+
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action?tab=readme-ov-file#readme)
123+
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action?tab=readme-ov-file#readme)
124+
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action?tab=readme-ov-file#readme)
125+
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action?tab=readme-ov-file#readme)
126+
- [Cloudflare Purge Cache Action](https://github.com/cssnr/cloudflare-purge-cache-action?tab=readme-ov-file#readme)
127+
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action?tab=readme-ov-file#readme)
128+
- [Docker Tags Action](https://github.com/cssnr/docker-tags-action?tab=readme-ov-file#readme)
128129

129130
For a full list of current projects to support visit: [https://cssnr.github.io/](https://cssnr.github.io/)

mirror.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: "Mirror"
22

33
on:
44
workflow_dispatch:
5-
release:
6-
types: ["published"]
75
push:
86
branches: ["**"]
97
tags: ["**"]

0 commit comments

Comments
 (0)