Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bence Csizmadia committed Apr 30, 2023
0 parents commit 2c2de06
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Just Do It

on:
push:
branches: [ "main" ]
schedule:
- cron: "*/30 * * * *"

jobs:
just_do_it:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 🔥
run: bin/doit

- name: 🤪
run: bin/commit ${{ secrets.TOKEN }} ${{ github.repository_owner }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## DO IT :wave: :wave: :wave:

10 changes: 10 additions & 0 deletions bin/commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

TOKEN=$1
OWNER=$2

git config user.name $OWNER
git config user.email $(curl -s -H "Authorization: Bearer $TOKEN" https://api.github.com/users/$OWNER | jq -r '.email')
git add .
git commit -m "just do it :see_no_evil: :sparkle:"
git push origin HEAD
9 changes: 9 additions & 0 deletions bin/doit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env ruby

# frozen_string_literal: true

require "fileutils"

require_relative "../lib/doit"

DOIT::doit
15 changes: 15 additions & 0 deletions lib/doit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module DOIT
@README = "./README.md"

def self.doit
contents = File.read(@README)
if contents.length % 2 == 0
File.write(@README, "#{contents} ")
else
contents.slice!(-1)
File.write(@README, contents)
end
end
end

0 comments on commit 2c2de06

Please sign in to comment.