diff --git a/.github/readme/partials/setup/action.md b/.github/readme/partials/setup/action.md
index 57a7cd82..6f0aea8f 100644
--- a/.github/readme/partials/setup/action.md
+++ b/.github/readme/partials/setup/action.md
@@ -89,6 +89,7 @@ As the latter is used as a development branch, jobs may fail from time to time (
When using a token with additional permissions, it is advised to fork this repository and use it instead to minimize security risks:
```yaml
- uses: my-github-username/metrics@master
+ # If you make changes on your fork, be sure not leave @latest as tag!
```
In this case, please consider watching new releases to stay up-to-date and enjoy latest features!
diff --git a/README.md b/README.md
index 5ff1f581..ef3b4680 100644
--- a/README.md
+++ b/README.md
@@ -224,7 +224,7 @@ Generate your metrics that you can embed everywhere, including your GitHub profi
-
See documentation 🌍 |
+ See documentation 🌍 |
@@ -328,6 +328,7 @@ As the latter is used as a development branch, jobs may fail from time to time (
When using a token with additional permissions, it is advised to fork this repository and use it instead to minimize security risks:
```yaml
- uses: my-github-username/metrics@master
+ # If you make changes on your fork, be sure not leave @latest as tag!
```
In this case, please consider watching new releases to stay up-to-date and enjoy latest features!
diff --git a/action.yml b/action.yml
index e5aa2d28..be6e71a8 100644
--- a/action.yml
+++ b/action.yml
@@ -589,16 +589,17 @@ runs:
docker image pull $METRICS_IMAGE > /dev/null
# Official action
elif [[ $METRICS_SOURCE == "lowlighter" ]]; then
- # Is unreleased version
+ # Is released version
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Is released version: $METRICS_IS_RELEASED"
- # Rebuild image for unreleased version
+ # Use registry for released version
if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then
echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry"
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
- # Use registry for released version
+ docker image pull $METRICS_IMAGE > /dev/null
+ # Rebuild image for unreleased version
else
echo "Using an unreleased version ($METRICS_VERSION)"
METRICS_IMAGE=metrics:$METRICS_VERSION
diff --git a/source/app/action/action.yml b/source/app/action/action.yml
index 244e6dd0..5a7c05d5 100644
--- a/source/app/action/action.yml
+++ b/source/app/action/action.yml
@@ -59,16 +59,17 @@ runs:
docker image pull $METRICS_IMAGE > /dev/null
# Official action
elif [[ $METRICS_SOURCE == "lowlighter" ]]; then
- # Is unreleased version
+ # Is released version
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Is released version: $METRICS_IS_RELEASED"
- # Rebuild image for unreleased version
+ # Use registry for released version
if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then
echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry"
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
- # Use registry for released version
+ docker image pull $METRICS_IMAGE > /dev/null
+ # Rebuild image for unreleased version
else
echo "Using an unreleased version ($METRICS_VERSION)"
METRICS_IMAGE=metrics:$METRICS_VERSION
diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs
index c7c39098..587d8ff9 100644
--- a/source/app/action/index.mjs
+++ b/source/app/action/index.mjs
@@ -5,6 +5,7 @@
import setup from "../metrics/setup.mjs"
import mocks from "../mocks/index.mjs"
import metrics from "../metrics/index.mjs"
+ process.on("unhandledRejection", error => { throw error })
//Debug message buffer
let DEBUG = true
@@ -31,7 +32,6 @@
//Initialization
info.break()
info.section(`Metrics`)
- process.on("unhandledRejection", error => { throw error })
//Skip process if needed
if ((github.context.eventName === "push")&&(github.context.payload?.head_commit)) {
@@ -133,7 +133,8 @@
object(expression: "${committer.branch}:${filename}") { ... on Blob { oid } }
}
}
- `
+ `,
+ {headers:{authorization:`token ${committer.token}`}}
)
committer.sha = oid
} catch (error) { console.debug(error) }
diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs
index 3ba769a2..32231dfd 100644
--- a/source/app/metrics/metadata.mjs
+++ b/source/app/metrics/metadata.mjs
@@ -262,7 +262,7 @@
return {
name:raw.match(/^### (?[\s\S]+?)\n/)?.groups?.name?.trim(),
readme:{
- demo:raw.match(/(?[\s\S]*?<[/]table>)/)?.groups?.demo?.replace(/<[/]?(?:table|tr)>/g, "")?.trim() ?? (name === "community" ? `| See documentation 🌍 | ` : " | "),
+ demo:raw.match(/(?[\s\S]*?<[/]table>)/)?.groups?.demo?.replace(/<[/]?(?:table|tr)>/g, "")?.trim() ?? (name === "community" ? `| See documentation 🌍 | ` : " | "),
compatibility:{...compatibility, base:true},
},
}
diff --git a/source/templates/community/README.md b/source/templates/community/README.md
index c07d2c30..053270d3 100644
--- a/source/templates/community/README.md
+++ b/source/templates/community/README.md
@@ -10,7 +10,7 @@ By default, community templates use `template.mjs` from official `classic` templ
If you trust it, append `+trust` after their name.
```yaml
-- uses: lowlighter/metrics@master
+- uses: lowlighter/metrics@latest
with:
# ... other options
template: "@super-metrics"