Skip to content

Commit 427e09f

Browse files
committed
Implementa idea del Playlist usando Actions (closes #77)
1 parent 43e2275 commit 427e09f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/canciones.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Playlist colaborativa
2+
on:
3+
push:
4+
paths:
5+
- 'playlist.src'
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
Crear-Playlist:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/[email protected]
16+
17+
- name: Escribir
18+
run: |
19+
echo "# 🎼🎼 La Radio 🎼🎼" > Playlist.md
20+
echo "## de estudiantes de GitHub en CódigoFacilito" >> Playlist.md
21+
cat playlist.src | awk -F ';' '{printf "%d. %s (%s)\n", NR, $1, $2 }' >> Playlist.md
22+
23+
echo "" >> Playlist.md
24+
echo "¡Para incluir canciones no edites directamente este fichero!" >> Playlist.md
25+
echo "¡Hazlo incluyendo una línea a \`playlist.src\`!" >> Playlist.md
26+
echo "" >> Playlist.md
27+
28+
- name: Configurar Git
29+
run: |
30+
git config user.name "github-actions"
31+
git config user.email "[email protected]"
32+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
33+
34+
- name: Commit y push
35+
run: |
36+
git add Playlist.md
37+
git commit -m "🎼🎼 La Radio 🎼🎼"
38+
git push origin HEAD
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

playlist.src

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Mrs. Robinson; Simon & Garfunkel
2+
Happy Together; The Turtles

0 commit comments

Comments
 (0)