~technomancy/fennel

fennel: Skip IRC reporting if we can't determine Git remote v1 PROPOSED

~michel-slm: 1
 Skip IRC reporting if we can't determine Git remote

 1 files changed, 4 insertions(+), 0 deletions(-)
#1312255 .build.yml success
Michel Lind <michel@michel-slm.name> writes:
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/54721/mbox | git am -3
Learn more about email & git

[PATCH fennel] Skip IRC reporting if we can't determine Git remote Export this patch

From: Michel Lind <salimma@fedoraproject.org>

This means either Git is not installed, or the test is being run from a
published tarball and not a Git checkout.

In either case, that means we don't want to report the build result
(many Linux distributions also build with network access disabled, so
reporting will fail anyway) - and we should exit with status code 0, as
this is not actually an error.
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
---
 test/irc.lua | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/irc.lua b/test/irc.lua
index e065800..d001145 100644
--- a/test/irc.lua
+++ b/test/irc.lua
@@ -3,6 +3,10 @@ local channel = os.getenv("IRC_CHANNEL")
local url = os.getenv("JOB_URL") or "???"

local remote = io.popen("git remote get-url origin"):read('*l')
if remote == nil then
    -- no git / no git repo, this is not an upstream CI job
    os.exit(0)
end
local is_origin = remote:find('~technomancy/fennel$') ~= nil

local branch = io.popen("git rev-parse --abbrev-ref HEAD"):read('*l')
-- 
2.45.2
fennel/patches/.build.yml: SUCCESS in 30s

[Skip IRC reporting if we can't determine Git remote][0] from [~michel-slm][1]

[0]: https://lists.sr.ht/~technomancy/fennel/patches/54721
[1]: mailto:michel@michel-slm.name

✓ #1312255 SUCCESS fennel/patches/.build.yml https://builds.sr.ht/~technomancy/job/1312255
~michel-slm <michel-slm@git.sr.ht> writes: