rlespinasse / drawio-export-action Goto Github PK
View Code? Open in Web Editor NEWGitHub Action To Export Draw.io Files
License: MIT License
GitHub Action To Export Draw.io Files
License: MIT License
To follow best practices on semver
Some use cases are difficult to test but can be simulated.
Currently, the test suite is not designed for that.
runner.sh
to be tested outside the Docker imageDescribe the bug
When the action is run on a new branch push, the run fails. This is because the script cannot find the previous reference and uses 0s.
To Reproduce
Create a new branch and push a DrawIO file on that branch.
Expected behavior
Should reference the last commit from the previous branch
Suppose I have a directory assets
with file diagram.drawio
in it.
I have to convert the diagram.drawio
to .png
in the same directory.
I used the following configuration:
- name: Render .drawio Files
uses: rlespinasse/drawio-export-action@v2
with:
format: png
path: assets
output: assets
action-mode: all
But apparently there is no such file as assets/diagram.png
.
I would like the file assets/diagram.png
to be generated as a result of described above example.
Finally I found another action, that didn't work either, but at least it could be patched:
- name: Render .drawio Files
uses: docker://ghcr.io/racklet/render-drawio-action:v1
with:
args: '"--sub-dirs=docs/assets" "--formats=png"'
However this action afaik is outdated and uses deprecated lib. I would love to use your action.
If I only knew how...
Support following options from drawio-export
image in a GitHub Action context
--on-changes
--git-ref <ref>
Currently, when a push is done for the first time or a push is force pushed :
auto
, then the action mode defaults to all
,recent
, then the action do nothing and stops the process properly.In order to improve the governance and the future of this action, I created a GitHub organization called Actions-Able which is composed of other action maintainers and co-maintainers I work with.
This issue concerns preparing the migration to this new ownership without breaking the current use of rlespinasse/drawio-export-action@...
in our user workflows.
Describe the bug
Our builds using this action started failing with the following message:
Step 2/4 : RUN apt-get update && apt-get install --no-install-recommends -y git=1:2.30.2-1 && rm -rf /var/lib/apt/lists/*
---> Running in a471eb992ff5
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [[48](https://github.com/TBCTSystems/bct-common-licensing-softwarekey/actions/runs/4852448319/jobs/8647443878#step:2:48).4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [237 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
Fetched 8643 kB in 1s (6962 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1:2.30.2-1' for 'git' was not found
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -y git=1:2.30.2-1 && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
To Reproduce
Use the action, our code as follows, but the error occurs during building the image from the Dockerfile:
- name: ๐ผ๏ธ Export drawio files to png files
uses: rlespinasse/[email protected]
with:
format: png
transparent: true
embed-diagram: true
path: ./docs/drawio/
output: ./images
action-mode: all
Expected behavior
Image builds successfully when using action
Is your feature request related to a problem? Please describe.
The action appears to have parameters to embed the source image in the generated PNG and SVG files. This information could be used to only regenerate the files if the embedded source differs from the current source file.
Describe the solution you'd like
Add a new action-mode
ร la embedded-diff
that regenerates the files only if the embedded source differs from the source file (or when there is no embedded source at all).
Describe alternatives you've considered
The only current alternative is to use git refs which requires a non-shallow clone.
Additional context
โ
Instead of doing this manually, we can use a GitHub Action workflow to periodically watch for newly released versions.
If we follow https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#versioning, this action needs to have a v2
tag that follows the latest release on the v2.x
branch and so on.
Is your feature request related to a problem? Please describe.
The action currently uses image: 'Dockerfile'
which means the Docker image is rebuilt any time the action is run. This takes about a minute which for many use cases is far greater than the time needed to actually run the image.
Describe the solution you'd like
Provide a pre-built image and use image: 'docker://...'
to speed up the action execution and avoid needlessly rebuilding the image.
Describe alternatives you've considered
โ
Additional context
โ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.